Skip to content

Conversation

@rjrudin
Copy link
Contributor

@rjrudin rjrudin commented Jul 17, 2023

Reworked some of the existing "write" tests to now use client.documents.read to verify data that was written.

@rjrudin rjrudin force-pushed the feature/503-read-docs branch from ebc62c0 to 30e2ebf Compare July 17, 2023 18:09
URI. By default, only content will be returned for each URI. See the endpoint
documentation for further information.
"""
response = self._get_multipart_documents_response(uris, categories, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be helpful if to return the response code if the URI isn't found?
What if there's a network or authentication error?
With Python, is it generally assumed that the user of these functions will do their own error handling?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll add a test user that lacks the "rest-reader" role and thus will get a 4xx, and I'll add a test to verify that it's returned.

So I think that will change the method signature to return either a list[Document] or a Response.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer need this now that we have a real "read" capability.

URI. By default, only content will be returned for each URI. See the endpoint
documentation for further information.
"""
response = self._get_multipart_documents_response(uris, categories, **kwargs)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll add a test user that lacks the "rest-reader" role and thus will get a 4xx, and I'll add a test to verify that it's returned.

So I think that will change the method signature to return either a list[Document] or a Response.

Reworked some of the existing "write" tests to now use `client.documents.read` to verify data that was written.
@rjrudin rjrudin force-pushed the feature/503-read-docs branch from 30e2ebf to 305de78 Compare July 17, 2023 18:54
assert {"hello": "world"} == doc.content


def test_not_rest_user(not_rest_user_client: Client):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BillFarber Added this test for a non-200 response.

@rjrudin rjrudin merged commit ecccf48 into develop Jul 19, 2023
@rjrudin rjrudin deleted the feature/503-read-docs branch July 19, 2023 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants