FileProvider WebApi interaction with file provider account
Review Request #6948 — Created Feb. 14, 2015 and updated
This FileProvider module allows users to select files from their online file storage providers to upload directly to ReviewBoard. In order to do so, there has to be way for users to interact with the FileProvider module. This is allowed by implementing webapi calls to interact with the back end. The new webapi integration supports the following:
- Listing files at the specified path in your file storage
- Searching for files in your file storage
- Uploading files from your online file storage to ReviewBoard
- Fetching a file's meta-information
As well as the general GET, POST, PUT and DELETE functionality for FileProvider object.
Test cases for GET, POST, PUT and DELETE for
reviewboard/webapi/resources/file_provider_account.py
are written.Test cases for search, list content and meta-information for
reviewboard/webapi/resources/file_provider_node.py
are written.Test cases and some manual tests with the file upload via file provider framework.
Description | From | Last Updated |
---|---|---|
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
Col: 40 W292 no newline at end of file |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 45 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
local variable 'rsp' is assigned to but never used |
reviewbot | |
Col: 79 W292 no newline at end of file |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
Col: 69 E502 the backslash is redundant between brackets |
reviewbot | |
Col: 69 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 32 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
'augment_method_from' imported but unused |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'ObjectDoesNotExist' imported but unused |
reviewbot | |
'Dir' imported but unused |
reviewbot | |
Col: 18 E203 whitespace before ',' |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'FPA' imported but unused |
reviewbot | |
Col: 25 E225 missing whitespace around operator |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
Docstrings should be formatted thusly: """A simple one-line summary. Detailed explanation. """ |
brennie | |
Blank line between these. |
brennie | |
"we turn them all into the correct object" ? "deep copy" |
brennie | |
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
Blank line between tehse. |
brennie | |
No blank line here. |
brennie | |
You can use for i, subitem in enumerate(item) here. Then you have access to both the index and the value. |
brennie | |
Blank line between these. |
brennie | |
Since you're using an elif, you may want an else: assert False case just to catch any mistakes. (This assumes … |
brennie | |
Blank line between these. |
brennie | |
The ObjectDoesNotExist error is a Django queryset-specific error. It is raised when a query cannot find a model instance matching … |
brennie | |
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
This documentation needs to be updated to reflect that the file may be provided via a FileProvider and not a … |
brennie | |
The two request.POST.get calls should be aligned. |
brennie | |
You can just add file_provider_id and file_provider_path as keyword arguments defaulting to None in the function definition and then you … |
brennie | |
You don't actually do anything with fields. Did you mean to return it with your INVALID_FORM_DATA response? |
brennie | |
No blank line here |
brennie | |
Wrap the conditional in parenthesis and you won't need the backslash. |
brennie | |
This is a super general exception. In this case, we really want to catch it and log it with its … |
brennie | |
No blank line here. |
brennie | |
No blank line here. |
brennie | |
Since this is for file provider accounts, shouldn't this be called FileProviderAccountResource ? |
brennie | |
Blank line between these. |
brennie | |
Trailing comma. |
brennie | |
Trailing comma |
brennie | |
Trailing comma |
brennie | |
Trailing comma. |
brennie | |
Trailing comma |
brennie | |
"A JSON blob..." |
brennie | |
Trailing comma. |
brennie | |
Trailing comma. |
brennie | |
"site" -> "provider" |
brennie | |
"for" -> "from" |
brennie | |
If you're allowing extra_data on this, you should mention it like the other resources that allow it do. |
brennie | |
Put the ) on the previous line. |
brennie | |
Trailing comma. |
brennie | |
Trailing comma. |
brennie | |
Trailing comma. |
brennie | |
Blank line between these. |
brennie | |
We format generators like so: remove_credential_keys = [ s.strip() for s in remove_credential_keys.split(',') ] |
brennie | |
Instead of 'Conflicts' perhaps use 'Is mutually exlcusive with' ? |
brennie | |
This should be FileProviderAccount.DoesNotExist, not the generic Django exception. Each model automatically has a subclass of the generic exception defined. … |
brennie | |
No blank line here. |
brennie | |
Alphabetize these. |
brennie | |
Blank line between these. |
brennie | |
Trailing comma here and elsewhere. |
brennie | |
Trailing comma. |
brennie | |
You can add the search and path as keyword arguments defaulting to None for this function. Then you don't have … |
brennie | |
"that each specify" |
brennie | |
'the name of the item and its type (either "file" or "folder")' |
brennie | |
"will list" |
brennie | |
Arguments to % formatting should go on the next line. |
brennie | |
If you are explicitly checking both options, you may want to add an else: assert False case here. |
brennie | |
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
Col: 80 W291 trailing whitespace |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 29 E126 continuation line over-indented for hanging indent |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
This is operating on self.content, modifying it in the process. That's not safe enough to do. What I'd suggest is … |
chipx86 | |
If the above is done as described, can this all be rolled up into that previous loop, based on the … |
chipx86 | |
"Return" |
chipx86 | |
The purpose of this isn't initially very clear. Might be worth a comment. Same in cases below. |
chipx86 | |
"Return" Same below. |
chipx86 | |
It's best not to reuse the same variable when it's representing different things (in this case, a file path and … |
chipx86 | |
The summary must be a single line. |
chipx86 | |
No need for parens. |
chipx86 | |
This can be one return FileProviderAccount.objects.create statement. |
chipx86 | |
APIs don't return exceptions> They return errors. Same below. |
chipx86 | |
Missing a space before the end of the string. |
chipx86 | |
"or with the file provider framework" could maybe be worded better. How about "..., or will send fields locating the … |
chipx86 | |
"ID" instead of "id". |
chipx86 | |
"Should not" isn't strong enough. How about "A file cannot be provided if file_provider_account_id or file_provider_path are also provided." |
chipx86 | |
Same sort of wording here. Also, this would be better as: fields['...'] = \ ['...'] |
chipx86 | |
Same comment about the wording. |
chipx86 | |
Should have a trailing comma. |
chipx86 | |
"frame' should be "framework". Also, this should pass request=request to the function. |
chipx86 | |
The wrapping might be better as: { 'file_provider_account_id': [ 'No file ...', ], } |
chipx86 | |
Similarly, we should have some differences here. Maybe predefine a string saying "Either path or both file_provider_account_id and file_provider_path are … |
chipx86 | |
"... requirements that need to be filled out and configured ..." |
chipx86 | |
We don't want to mention internal classes here. I'd base the wording off of other resources. |
chipx86 | |
"... specific to ..." |
chipx86 | |
"The information is used to authenticate with the file provider." |
chipx86 | |
extra_data isn't actually a field that gets set in requests. We don't want to include this. |
chipx86 | |
Should have similar wording to the ones I recommended above. |
chipx86 | |
Maybe "Clients can choose ..." |
chipx86 | |
You should raise a ValueError here, in order to reuse the error result below. |
chipx86 | |
Swap these. It's nice not to have a not unnecessarily. |
chipx86 | |
Maybe "Valid credentials were not provided." |
chipx86 | |
In REST APIs, we're dealing with setting fields. The "remove" type of object should not be here. Instead, just have … |
chipx86 | |
This shouldn't be here. Same reason as above. |
chipx86 | |
Make sure to change this when the above is changed. |
chipx86 | |
We use "Deletes" twice: In the summary, and in the first sentence. Maybe we can change that. The second sentence … |
chipx86 | |
Swap these. They should be in alphabetical order. |
chipx86 | |
I don't think we need to say "... that is found." Same below. |
chipx86 | |
Maybe file_node? We usually use rsp as "response", as in a JSON blob. |
chipx86 | |
Do we want path to be optional? Or required? |
chipx86 | |
The wording here needs some work: "The path in the provider representing a directory or file to return information on, … |
chipx86 | |
The description and type are inconsistent. The type should be a bool. |
chipx86 | |
Which filename? |
chipx86 | |
Tuples aren't a good way to structure this. They're too limiting long-term, and harder to consume. Entries should be dictionaries … |
chipx86 | |
".. or are related ..." |
chipx86 | |
I don't know that we want a new error code for this. It means clients have to special-case the error. … |
chipx86 | |
"at the path." |
chipx86 | |
No blank line here. |
chipx86 | |
This is a pretty generic excepetion for throwing and catching here. If anything else were to throw this (list_folder, for … |
chipx86 | |
No blank line here. |
chipx86 | |
No blank line here. |
chipx86 | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'PIPELINE_CSS' imported but unused |
reviewbot | |
'PIPELINE_JS' imported but unused |
reviewbot | |
Should start with a capital letter and end in a period. |
david | |
Should start with a capital letter and end in a period. |
david | |
Can we call this variable field_errors? |
david | |
Wrap the entire string in parens and then you don't need the + \\ (two strings next to each other … |
david | |
Should be in the imperative mood ("Create") |
david | |
This should have a docstring. |
david | |
Should be in the imperative mood ("Update") |
david | |
Should be in the imperative mood ("Delete") |
david | |
Should be in the imperative mood. |
david | |
Should be in the imperative mood. |
david | |
Should be in the imperative mood. |
david | |
INVALID_FORM_DATA doesn't seem like the right thing here. |
david | |
This should have a docstring. |
david | |
Docstring. |
david | |
Two blank lines here. |
david |
- Change Summary:
-
Refactored to use get_queryset, and updated any other functions as appropriate.
Change the test cases to match the refactoring.
Updated reviewboard/testing/fileprovider.py to use the new FileProviderFile for its return.
- Commit:
-
d5814dbb99eed422d182e54a591fdbb190e4deaa
- Diff:
-
Revision 2 (+1369 -1)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/root.py reviewboard/webapi/errors.py reviewboard/webapi/tests/test_file_provider_file.py reviewboard/testing/fileprovider.py reviewboard/webapi/resources/file_provider_file.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/test_file_provider.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/root.py reviewboard/webapi/errors.py reviewboard/webapi/tests/test_file_provider_file.py reviewboard/testing/fileprovider.py reviewboard/webapi/resources/file_provider_file.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/test_file_provider.py
-
-
-
-
-
- Change Summary:
-
Added the upload to a review request via file attachments. Also added test cases for this new implementation. Cleaned up the
file_provider.py
andfile_provider_file.py
, with updated decorators, styling and documentation. Also did clean up for their test cases. Fortesting/fileprovider.py
, added an implementation forget_file
for testing. - Commit:
-
d5814dbb99eed422d182e54a591fdbb190e4deaa092c7c38ab7679d093a2867058525797ed4bce64
- Diff:
-
Revision 3 (+1588 -8)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/root.py reviewboard/webapi/errors.py reviewboard/webapi/tests/test_file_provider_file.py reviewboard/testing/fileprovider.py reviewboard/webapi/resources/file_provider_file.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/test_file_provider.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/root.py reviewboard/webapi/errors.py reviewboard/webapi/tests/test_file_provider_file.py reviewboard/testing/fileprovider.py reviewboard/webapi/resources/file_provider_file.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/test_file_provider.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Removed WIP. Also, unique checks are made to avoid duplicates, as well as style cleaning for PEP8. Change of the name of the djblets.error to match the new one.
- Summary:
-
[WIP] FileProvider WebApi integratonFileProvider WebApi integraton
- Depends On:
-
- Commit:
092c7c38ab7679d093a2867058525797ed4bce648c6f7eab628378997c94deff6eb5b1ff57e4bfbe- Diff:
Revision 4 (+1590 -8)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/root.py reviewboard/webapi/errors.py reviewboard/webapi/tests/test_file_provider_file.py reviewboard/testing/fileprovider.py reviewboard/webapi/resources/file_provider_file.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/test_file_provider.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/root.py reviewboard/webapi/errors.py reviewboard/webapi/tests/test_file_provider_file.py reviewboard/testing/fileprovider.py reviewboard/webapi/resources/file_provider_file.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/test_file_provider.py
-
-
-
-
- Testing Done:
-
~ Test cases for GET, POST, PUT and DELETE for
reviewboard/webapi/resources/file_provider.py
are written.~ Test cases for search, list content and meta-information for reviewboard/webapi/resources/file_provider_file.py
are written.~ Test cases for GET, POST, PUT and DELETE for
reviewboard/webapi/resources/file_provider.py
are written.~ + Test cases for search, list content and meta-information for
reviewboard/webapi/resources/file_provider_file.py
are written.+ + Test cases and some manual tests with the file upload via file provider framework.
- Change Summary:
-
Changed test cases to use proper asserts, and removed all assert error messages. Added ObjectNotFound exceptions for files not found in search and others with webapi calls. Added item types 'File' or 'Directory' to the models when returned from webapi get calls. Refactored code to match update in
reviewboard/fileproviders/tree.py
. - Commit:
-
8c6f7eab628378997c94deff6eb5b1ff57e4bfbe48a50b86b5543f661955878863c8df9f22c60c59
- Diff:
-
Revision 5 (+1701 -9)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/root.py reviewboard/webapi/errors.py reviewboard/webapi/tests/test_file_provider_file.py reviewboard/testing/fileprovider.py reviewboard/webapi/resources/file_provider_file.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/test_file_provider.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/root.py reviewboard/webapi/errors.py reviewboard/webapi/tests/test_file_provider_file.py reviewboard/testing/fileprovider.py reviewboard/webapi/resources/file_provider_file.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/test_file_provider.py
-
-
-
-
-
-
-
- Change Summary:
-
Updated to adhere to PEP8 and Pyflakes.
- Commit:
-
48a50b86b5543f661955878863c8df9f22c60c596812f81dbe9b83b2d978b7c4389d1cf3a5cee028
- Diff:
-
Revision 6 (+1701 -9)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/root.py reviewboard/webapi/errors.py reviewboard/webapi/tests/test_file_provider_file.py reviewboard/testing/fileprovider.py reviewboard/webapi/resources/file_provider_file.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/test_file_provider.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/root.py reviewboard/webapi/errors.py reviewboard/webapi/tests/test_file_provider_file.py reviewboard/testing/fileprovider.py reviewboard/webapi/resources/file_provider_file.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/test_file_provider.py
-
-
-
-
- Change Summary:
-
Refactored the variable and class names:
FileProviderFile -> FileProviderNode file_path -> node_path path -> dir
This is to match new naming with changes in reviewboard/fileproviders.
New test cases were added for FileProviderNode, getting a folder from a file
Updated the testing FileProvider objects.
Removed unused test check
- Commit:
-
6812f81dbe9b83b2d978b7c4389d1cf3a5cee028d2349e9d4938273eadcca157adc4d6fcfed14826
- Diff:
-
Revision 7 (+1730 -9)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
-
-
- Change Summary:
-
Chaged the file-providers/<id>/files/ url to file-providers/<id>/tree url.
Updated documentation for test case to reflect these changes.
Fixed issue in the testing unit for reviewboard/testing/fileprovider.py
Updated pep8 styling.
- Commit:
-
d2349e9d4938273eadcca157adc4d6fcfed14826723b363fd9ef263c059df5c06cf6f3322e3fb530
- Diff:
-
Revision 8 (+1729 -9)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
- Change Summary:
-
Updated to reflect changes in reviewboard/fileproviders/tree.py
- Commit:
-
723b363fd9ef263c059df5c06cf6f3322e3fb530ac0aa7026c58a33df3c62c30fcf24b3d9ee93b41
- Diff:
-
Revision 9 (+1721 -9)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
- Change Summary:
-
Changed expected status code for reviewboard.webapi.tests.test_file_provider:ResourceListTests.test_post_with_duplicate_accounts to reflect changes in djblet
- Commit:
-
ac0aa7026c58a33df3c62c30fcf24b3d9ee93b41c8956e221e2070bbb4ea5991c877ef1675b3b9a8
- Diff:
-
Revision 10 (+1721 -9)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
-
-
-
-
-
-
-
-
-
You can use
for i, subitem in enumerate(item)
here. Then you have access to both the index and the value. -
-
Since you're using an
elif
, you may want anelse: assert False
case just to catch any mistakes. (This assumes thatdict
andlist
are the only such options.) -
-
The
ObjectDoesNotExist
error is a Django queryset-specific error. It is raised when a query cannot find a model instance matching the give queryset.It is probably worth it to subclass exception as
FileProviderError
and, if needed, you can subclass that for aFileNotFoundError
(or similar) that is specific to file providers. -
-
-
-
This documentation needs to be updated to reflect that the file may be provided via a
FileProvider
and not a file upload. -
-
You can just add
file_provider_id
andfile_provider_path
as keyword arguments defaulting toNone
in the function definition and then you don't have to userequest.POST
every time.It will also making your formatting easier because the arguments won't be as long.
-
You don't actually do anything with
fields
. Did you mean to return it with yourINVALID_FORM_DATA
response? -
-
-
This is a super general exception. In this case, we really want to catch it and log it with its traceback.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
If you're allowing
extra_data
on this, you should mention it like the other resources that allow it do. -
-
-
-
-
-
We format generators like so:
remove_credential_keys = [ s.strip() for s in remove_credential_keys.split(',') ]
-
-
This should be
FileProviderAccount.DoesNotExist
, not the generic Django exception. Each model automatically has a subclass of the generic exception defined.This is another reason why I want to discourage you from using the generic
ObjectDoesNotExist
error elsewhere. You don't want to accidentally catch the wrong exception and have the wrong error-handling code. -
-
-
-
-
-
You can add the
search
andpath
as keyword arguments defaulting toNone
for this function. Then you don't have to hassle withrequest.GET
. -
-
-
-
-
-
-
-
- Change Summary:
-
Add changes to reflect the changes for /r/6806.
- reviewboard.fileproviders.tree.Node new variable names and initialization param order propagated to testing and webapi. - Removal of parenthesis for imports. - Additional comments and code clean-up was done.
- Commit:
-
c8956e221e2070bbb4ea5991c877ef1675b3b9a8c9b816057d30e7fffaf66c08b48b2d6c9cc9bfac
- Diff:
-
Revision 11 (+1723 -9)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
-
- Change Summary:
-
Made changes as suggested by reviews
- code styling (blank spaces, indentation, etc.) - adding and updating documentation - Added new usage of new error (NodeNotFoundError) for interaction with FileProvider framework - function definitions updated to include required params, instead of retreiving from request object
- Commit:
-
c9b816057d30e7fffaf66c08b48b2d6c9cc9bfac06028be05eb7ad8ccf91d8a587e34fa7dc6e5784
- Diff:
-
Revision 12 (+1784 -11)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/test_file_provider.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
- Change Summary:
-
Renaming of the FileProviderResource to FileProviderAccount resource. Propagate the change of the name as necessary (for variables, docstring, file names, etc.)
Added metadata to initalization of Files in reviewboard.testing.fileproviders
- Commit:
-
06028be05eb7ad8ccf91d8a587e34fa7dc6e57848102391aaca2332ed5489e250c6490563b55db86
- Diff:
-
Revision 13 (+1787 -11)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
-
-
- Change Summary:
-
Fixed for pyflakes and pep-8 styling.
- Commit:
-
8102391aaca2332ed5489e250c6490563b55db8667b7196f1e063ec273b7c1baa838b5ce05df715e
- Diff:
-
Revision 14 (+1788 -11)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
- Change Summary:
-
Added more name changes to variables to represent change of resource
FileProviderResource
(the old way to represent File Provider Accounts) toFileProviderAccountResource
. - Summary:
-
FileProvider WebApi integratonFileProvider WebApi interaction with file provider account
- Testing Done:
-
~ Test cases for GET, POST, PUT and DELETE for
reviewboard/webapi/resources/file_provider.py
are written.~ Test cases for GET, POST, PUT and DELETE for
reviewboard/webapi/resources/file_provider_account.py
are written.~ Test cases for search, list content and meta-information for
reviewboard/webapi/resources/file_provider_file.py
are written.~ Test cases for search, list content and meta-information for
reviewboard/webapi/resources/file_provider_node.py
are written.Test cases and some manual tests with the file upload via file provider framework.
- Commit:
-
67b7196f1e063ec273b7c1baa838b5ce05df715e897bf339119d311786cb26f82772e0939212f901
- Diff:
-
Revision 15 (+1791 -11)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
-
- Change Summary:
-
Fixed character length limit.
- Commit:
-
897bf339119d311786cb26f82772e0939212f901fee773bbdc96cab414f4afca7580dc2a29dcaa73
- Diff:
-
Revision 16 (+1792 -11)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
- Change Summary:
-
Renamed the file_provider_id to file_provider_account_id, matching to the new FileProviderAccountResource renaming.
- Commit:
-
fee773bbdc96cab414f4afca7580dc2a29dcaa73120fe23af4315b862738ececeb5940c6b0eeaa86
- Diff:
-
Revision 17 (+1794 -11)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
- Change Summary:
-
In order to line-up with credentials default value of {} in the models, had to remove the length check for credentials for
api/file-provider-accounts/
POST requests to allow creation - Commit:
-
120fe23af4315b862738ececeb5940c6b0eeaa860121c613fbf432c071f46e7ae51c4c0faa341e95
- Diff:
-
Revision 18 (+1788 -11)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
-
I know this is a long review, but it's a long change.
I didn't look at the unit tests too closely. The vast majority of the comments are documentation changes for the public API. There are a few small design notes I have though.
-
This is operating on
self.content
, modifying it in the process. That's not safe enough to do. What I'd suggest is buildingself.content
off of the version in the class, and not copying it first.Maybe that can be called
DEFAULT_CONTENT
at that point. -
If the above is done as described, can this all be rolled up into that previous loop, based on the path content in the version in the class?
-
-
-
-
It's best not to reuse the same variable when it's representing different things (in this case, a file path and then a file handle).
Also, single quotes are preferable over double quotes when possible.
-
-
-
-
-
-
"or with the file provider framework" could maybe be worded better. How about "..., or will send fields locating the file on a registered file provider."
-
-
"Should not" isn't strong enough. How about "A file cannot be provided if file_provider_account_id or file_provider_path are also provided."
-
-
-
-
-
-
Similarly, we should have some differences here.
Maybe predefine a string saying "Either path or both file_provider_account_id and file_provider_path are required."
-
-
-
-
-
-
-
-
-
-
-
In REST APIs, we're dealing with setting fields. The "remove" type of object should not be here. Instead, just have "credentials" overwrite.
Also, as above, we shouldn't reference "FileProviderAccount" in API docs, since it's an internal detail.
-
-
-
We use "Deletes" twice: In the summary, and in the first sentence. Maybe we can change that.
The second sentence should probably say "For some file providers, Review Board's authentication token will be removed from the service, preventing the token from being re-used. This is not supported for all services."
-
-
-
-
-
The wording here needs some work:
"The path in the provider representing a directory or file to return information on, or a search string (if ``search`` is true)."
-
-
-
Tuples aren't a good way to structure this. They're too limiting long-term, and harder to consume. Entries should be dictionaries instead, and should be structured like item resources.
-
-
I don't know that we want a new error code for this. It means clients have to special-case the error. I think this should be an
INVALID_FORM_DATA
error that includes reasonable error message for thesearch
field instead. -
-
-
This is a pretty generic excepetion for throwing and catching here. If anything else were to throw this (
list_folder
, for instance), then the caller will get an unexpected error (one referencing "search" for instance). -
-
- Change Summary:
-
Updated all files which made use of
path_sep
for FileProvider objects to not use them, but/
instead.Cleaned up a lot of the documentation to be more up to date, correct and accurate.
The test classes for FileProvider objects now have an improved initialization that uses cached data, speeding up test cases.
Removed
removed_credentials
from api/file-provider-accounts/ PUT request, as that is no longer supported.Removed
FILE_PROVIDER_DOES_NOT_SUPPORT_SEARCH
from reviewboard/webapi/errors.py file.Updated the test cases appropriately to match the changes here and in r/6806
Lots of other code clean-up with ordering and styling.
- Commit:
-
0121c613fbf432c071f46e7ae51c4c0faa341e95c9329bcb849844cde0aac86ef57c2ddc988c69bf
- Diff:
-
Revision 19 (+1741 -11)
-
Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/webapi/resources/base_file_attachment.py reviewboard/webapi/resources/__init__.py reviewboard/settings.py reviewboard/webapi/resources/file_provider_node.py reviewboard/webapi/errors.py reviewboard/testing/fileprovider.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/test_file_attachment.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/root.py reviewboard/webapi/resources/file_provider_account.py reviewboard/webapi/tests/test_file_provider_account.py reviewboard/webapi/tests/test_file_provider_node.py
-
-
-
-
- Change Summary:
-
Changed the
search
fuction for the testing fileproviders to require path as input.Also, changed the default for get_list
path
parameter to be/
- Commit:
-
c9329bcb849844cde0aac86ef57c2ddc988c69bf2ba622f0c12cded48d2d34595773ce07c954ee39
- Diff:
-
Revision 20 (+1741 -11)