-
Notifications
You must be signed in to change notification settings - Fork 41
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
[IO-1801][external] Core item archive method & tests #702
Conversation
IO-1801 Core: Edit items: Archive
|
@@ -245,3 +245,5 @@ def raise_for_darwin_exception(response: requests.Response) -> None: | |||
raise Unauthorized(response) | |||
if response.status_code == 404: | |||
raise NotFound(response) | |||
if response.status_code == 422: |
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.
We may want to surface / deal with / pprint 422s later, especially because the endpoints generally do a good job of pointing out exactly what causes 422s
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.
Only one change, and it's really minor lint change at the bottom - this is good stuff mate.
responses.add( | ||
responses.POST, | ||
base_client.config.api_endpoint + "v2/teams/test-team/items/archive", | ||
json={"affected_item_count": 0}, |
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.
Really minor point, but your affect item count here is mocked as 0, when if successful, it would've been 2.
Honestly, only fix if you want to.
assert response == {"affected_item_count": 0} | ||
|
||
|
||
def test_archive_items_with_error_response(base_client: ClientCore) -> None: |
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.
base_client
fixture is included but not used here.
Problem
Currently no way to archive items in
darwin.future
Solution
Define the core method to archive a list of items by their UUIDs by using the archive endpoint
Changelog
Added core item archive method & tests