-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix get_collections and conformance checking behavior #120
Fix get_collections and conformance checking behavior #120
Conversation
Codecov Report
@@ Coverage Diff @@
## main #120 +/- ##
==========================================
+ Coverage 78.71% 79.96% +1.24%
==========================================
Files 9 9
Lines 545 544 -1
==========================================
+ Hits 429 435 +6
+ Misses 116 109 -7
Continue to review full report at Codecov.
|
@@ -7,6 +7,7 @@ pytest-cov~=2.11.1 | |||
pytest-recording~=0.11.0 | |||
pytest-console-scripts~=1.1.0 | |||
recommonmark~=0.7.1 | |||
requests-mock~=1.9.3 |
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.
NBD but this will conflict with #118 (maybe auto-deconflictable?).
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.
Yeah, I'm not sure if git will just resolve it automatically since it's the same change in the same place, but either way it should be easy to resolve. I can rebase one of these PRs once the other has been merged if it helps.
This all makes sense to me WRT the behavior of the asset function. Thanks for the PR and big thanks for the additional tests |
Related Issue(s):
None
Description:
The
Client.get_collections
docs state that it will fallback to thepystac.Catalog
behavior of following"child"
links if the API landing page does not include the proper conformance class for the/collections
endpoint. The actual behavior when running this against an API that lacks the conformance class is that aNotImplementedError
is raised:The root cause was that
StacApiIO.assert_conforms_to
was being used inif
statements that expected a boolean response when in fact it returnedTrue
if the API conformed and raised the above exception if it did not. Having this kind of mixed response seemed like a confusing pattern, so I changed that method to raise the exception when conformance fails and not have any return value. Code that expects a boolean response now exclusively uses theStacApiIO.conforms_to
method.PR Checklist: