Skip to content

Conversation

@matthewhanson
Copy link
Member

Related Issue(s): #

Description:
Include headers in initial call to API, and fix inclusion of headers in the CLI

PR Checklist:

  • Code is formatted
  • Tests pass
  • Changes are added to the CHANGELOG

matthewhanson and others added 2 commits April 15, 2021 13:01
* Include headers in initial client load

To do this, we had to copy over the `STACObject.from_file` method from
pystac, becuase that method did some URL absolutization before
using STAC_IO.read_text_method, which breaks our custom
urllib.request.Request handling. It's not a perfect solution -- it might
be better to make the pystac method smarter -- but it's a quick fix.

This commit also adds:
- Return codes for the cli
- A simple cli test
- An extra dev dependency (pytest-console-scripts) to test to cli

* Switch to a monkeypath

* Remove print

* Add headers to the stac_io logging

* add header logging to search

* Allow headers to be a file
@codecov-io
Copy link

codecov-io commented Apr 15, 2021

Codecov Report

Merging #39 (f034bad) into main (f92b65a) will increase coverage by 9.24%.
The diff coverage is 64.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
+ Coverage   76.07%   85.32%   +9.24%     
==========================================
  Files          13       13              
  Lines         602      620      +18     
==========================================
+ Hits          458      529      +71     
+ Misses        144       91      -53     
Impacted Files Coverage Δ
pystac_client/cli.py 66.26% <30.76%> (+66.26%) ⬆️
pystac_client/stac_io.py 90.90% <66.66%> (ø)
pystac_client/client.py 98.43% <100.00%> (+5.71%) ⬆️
pystac_client/item_search.py 80.54% <100.00%> (ø)
pystac_client/item_collection.py 72.22% <0.00%> (+11.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f92b65a...f034bad. Read the comment docs.

@matthewhanson matthewhanson changed the title Mah/fix headers Fix headers Apr 15, 2021
@matthewhanson matthewhanson marked this pull request as ready for review April 16, 2021 03:44
@matthewhanson matthewhanson merged commit b3910ef into main Apr 16, 2021
@matthewhanson matthewhanson deleted the mah/fix_headers branch April 16, 2021 03:45
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.

4 participants