-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PY-386][external] Core method to move items between folders & tests #709
Conversation
PY-386 Core: Edit items: move to folder
|
if response.status_code == 400: | ||
raise BadRequest(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As covered in my comment in PY-386 here, we probably want to catch the 400 errors this endpoint can throw in Core
To do this, I introduced the BadRequest
class. This broke some existing tests that returned 400s, as previously they were expecting HTTPError
, so updated each breaking test to expect BadRequest instead
|
||
|
||
def test_move_list_of_items_to_folder_with_error_response() -> None: | ||
api_client = Mock(spec=ClientCore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They both achieve the same thing but for consistency can you move this to a responses.RequestMock approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense - There are a few other tests written this way, I'll update them as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nathanjp91 introduced the use of responses
on this stuff, but it has become the paradigm overall, and it's a good example of socialised testing when used well.
|
||
|
||
def test_move_list_of_items_to_folder_with_error_response() -> None: | ||
api_client = Mock(spec=ClientCore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nathanjp91 introduced the use of responses
on this stuff, but it has become the paradigm overall, and it's a good example of socialised testing when used well.
Problem
Currently no way to move items between folders in
darwin.future
Solution
Define the core method to move a list of items by their UUIDs by using the path endpoint
Changelog
Added core method to move items between folders