vascobnunes / fetchLandsatSentinelFromGoogleCloud

Find and download Landsat and Sentinel-2 data from the public Google Cloud
https://vascobnunes.github.io/fetchLandsatSentinelFromGoogleCloud/
MIT License
52 stars 23 forks source link

Add tests, fixed a bug, use pytest on CI #61

Closed Erotemic closed 2 years ago

Erotemic commented 2 years ago

Adds a unit test to verify that the commands in the README really do produce the same results.

While writing this test I found a small bug when --dates is given to S2, there was a typo in the method name.

Also fixed a typo in the help strings.

Lastly, the CI now runs with pytest instead of just xdoctest. This makes it easier to combine doctests and unit tests. Coverage on my local machine is:

----------- coverage: platform linux, python 3.8.6-final-0 -----------
Name                                                                        Stmts   Miss  Cover
-----------------------------------------------------------------------------------------------
/home/joncrall/code/fetchLandsatSentinelFromGoogleCloud/fels/__init__.py        9      0   100%
/home/joncrall/code/fetchLandsatSentinelFromGoogleCloud/fels/__main__.py        4      1    75%
/home/joncrall/code/fetchLandsatSentinelFromGoogleCloud/fels/fels.py          160     19    88%
/home/joncrall/code/fetchLandsatSentinelFromGoogleCloud/fels/landsat.py       107     42    61%
/home/joncrall/code/fetchLandsatSentinelFromGoogleCloud/fels/sentinel2.py     187    126    33%
/home/joncrall/code/fetchLandsatSentinelFromGoogleCloud/fels/utils.py         111     62    44%
-----------------------------------------------------------------------------------------------
TOTAL                                                                         578    250    57%

Should be roughly the same on the CI.