Skip to content

Commit

Permalink
tests added using vcrpy
Browse files Browse the repository at this point in the history
  • Loading branch information
konstntokas committed Apr 29, 2024
1 parent 4a79510 commit 15c46c8
Show file tree
Hide file tree
Showing 23 changed files with 4,414 additions and 43 deletions.
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ channels:
dependencies:
# Required
- pystac
- pystac-client
- xarray
- xcube
# for testing
- black
- flake8
- pytest
- pytest-recording
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ readme = {file = "README.md", content-type = "text/markdown"}
license = {text = "MIT"}
requires-python = ">=3.10"
dependencies = [
"pystac",
"pystac-client",
"xarray",
"pystac"
"xcube"

]

[tool.setuptools.dynamic]
Expand Down
32 changes: 16 additions & 16 deletions test/cassettes/test_stac/StacTest.test_open_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ interactions:
Cross-Origin-Resource-Policy:
- cross-origin
Date:
- Mon, 29 Apr 2024 07:17:47 GMT
- Mon, 29 Apr 2024 09:40:39 GMT
ETag:
- W/"acb7a8d6636e24e32f4018c14f1c4ff418a82567b2746560f9eae6ad97a48a54"
Expires:
- Mon, 29 Apr 2024 07:22:47 GMT
- Mon, 29 Apr 2024 09:45:39 GMT
Source-Age:
- '0'
- '37'
Strict-Transport-Security:
- max-age=31536000
Vary:
Expand All @@ -57,19 +57,19 @@ interactions:
X-Cache:
- HIT
X-Cache-Hits:
- '0'
- '3'
X-Content-Type-Options:
- nosniff
X-Fastly-Request-ID:
- 344a512757346e05efdecf5aa2682cdcef8dcad8
- 1344da34a305e1ad724b5ff5775b6496d4340ff3
X-Frame-Options:
- deny
X-GitHub-Request-Id:
- 1DE8:173356:F4B7AD:102B867:662F47E6
- AAE2:26494:2404BC4:260086D:662F654D
X-Served-By:
- cache-cph2320044-CPH
- cache-cph2320046-CPH
X-Timer:
- S1714375067.314031,VS0,VE189
- S1714383639.266545,VS0,VE0
X-XSS-Protection:
- 1; mode=block
status:
Expand Down Expand Up @@ -113,13 +113,13 @@ interactions:
Cross-Origin-Resource-Policy:
- cross-origin
Date:
- Mon, 29 Apr 2024 07:17:47 GMT
- Mon, 29 Apr 2024 09:40:39 GMT
ETag:
- '"e74ebcbc46d43c5b693ecb995381fbeba03583627e6d65b21ed7678a10d94729"'
Expires:
- Mon, 29 Apr 2024 07:22:47 GMT
- Mon, 29 Apr 2024 09:45:39 GMT
Source-Age:
- '0'
- '37'
Strict-Transport-Security:
- max-age=31536000
Vary:
Expand All @@ -129,19 +129,19 @@ interactions:
X-Cache:
- HIT
X-Cache-Hits:
- '0'
- '1'
X-Content-Type-Options:
- nosniff
X-Fastly-Request-ID:
- 79c19ac6794d41453b28a64c116e790ddf093d4b
- 7e45b04e3ce790c6f2b04d14e258ae95f8080c52
X-Frame-Options:
- deny
X-GitHub-Request-Id:
- 1DE8:173356:F4B7D3:102B885:662F47E6
- AAE2:26494:2404BDD:2600886:662F654D
X-Served-By:
- cache-cph2320046-CPH
- cache-cph2320033-CPH
X-Timer:
- S1714375068.539807,VS0,VE152
- S1714383639.317881,VS0,VE1
X-XSS-Protection:
- 1; mode=block
status:
Expand Down
150 changes: 150 additions & 0 deletions test/cassettes/test_store/StacDataOpenerTest.test_describe_data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
interactions:
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate, br
Connection:
- keep-alive
User-Agent:
- python-requests/2.31.0
method: GET
uri: https://raw.githubusercontent.com/stac-extensions/label/main/examples/multidataset/catalog.json
response:
body:
string: "{\n \"stac_version\": \"1.0.0-rc.1\",\n \"type\": \"Catalog\",\n
\ \"id\": \"label_extension_demo\",\n \"title\": \"label extension demo\",\n
\ \"description\": \"Sample ML training data labels in the STAC format\",\n
\ \"links\": [\n {\n \"rel\": \"root\",\n \"href\": \"./catalog.json\"\n
\ },\n {\n \"rel\": \"child\",\n \"href\": \"zanzibar/collection.json\"\n
\ },\n {\n \"rel\": \"child\",\n \"href\": \"spacenet-buildings/collection.json\"\n
\ }\n ]\n}"
headers:
Accept-Ranges:
- bytes
Access-Control-Allow-Origin:
- '*'
Cache-Control:
- max-age=300
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Length:
- '236'
Content-Security-Policy:
- default-src 'none'; style-src 'unsafe-inline'; sandbox
Content-Type:
- text/plain; charset=utf-8
Cross-Origin-Resource-Policy:
- cross-origin
Date:
- Mon, 29 Apr 2024 09:40:39 GMT
ETag:
- W/"acb7a8d6636e24e32f4018c14f1c4ff418a82567b2746560f9eae6ad97a48a54"
Expires:
- Mon, 29 Apr 2024 09:45:39 GMT
Source-Age:
- '37'
Strict-Transport-Security:
- max-age=31536000
Vary:
- Authorization,Accept-Encoding,Origin
Via:
- 1.1 varnish
X-Cache:
- HIT
X-Cache-Hits:
- '4'
X-Content-Type-Options:
- nosniff
X-Fastly-Request-ID:
- 7e4ffdd86bcd0b9e0efc59a81f9135935bef4b32
X-Frame-Options:
- deny
X-GitHub-Request-Id:
- AAE2:26494:2404BC4:260086D:662F654D
X-Served-By:
- cache-cph2320033-CPH
X-Timer:
- S1714383639.381612,VS0,VE0
X-XSS-Protection:
- 1; mode=block
status:
code: 200
message: OK
- request:
body: null
headers:
Connection:
- close
Host:
- raw.githubusercontent.com
User-Agent:
- Python-urllib/3.12
method: GET
uri: https://raw.githubusercontent.com/stac-extensions/label/main/examples/multidataset/catalog.json
response:
body:
string: "{\n \"stac_version\": \"1.0.0-rc.1\",\n \"type\": \"Catalog\",\n
\ \"id\": \"label_extension_demo\",\n \"title\": \"label extension demo\",\n
\ \"description\": \"Sample ML training data labels in the STAC format\",\n
\ \"links\": [\n {\n \"rel\": \"root\",\n \"href\": \"./catalog.json\"\n
\ },\n {\n \"rel\": \"child\",\n \"href\": \"zanzibar/collection.json\"\n
\ },\n {\n \"rel\": \"child\",\n \"href\": \"spacenet-buildings/collection.json\"\n
\ }\n ]\n}"
headers:
Accept-Ranges:
- bytes
Access-Control-Allow-Origin:
- '*'
Cache-Control:
- max-age=300
Connection:
- close
Content-Length:
- '436'
Content-Security-Policy:
- default-src 'none'; style-src 'unsafe-inline'; sandbox
Content-Type:
- text/plain; charset=utf-8
Cross-Origin-Resource-Policy:
- cross-origin
Date:
- Mon, 29 Apr 2024 09:40:39 GMT
ETag:
- '"e74ebcbc46d43c5b693ecb995381fbeba03583627e6d65b21ed7678a10d94729"'
Expires:
- Mon, 29 Apr 2024 09:45:39 GMT
Source-Age:
- '37'
Strict-Transport-Security:
- max-age=31536000
Vary:
- Authorization,Accept-Encoding,Origin
Via:
- 1.1 varnish
X-Cache:
- HIT
X-Cache-Hits:
- '2'
X-Content-Type-Options:
- nosniff
X-Fastly-Request-ID:
- 5db6f1f405950648a55dead57d23d6458a34621e
X-Frame-Options:
- deny
X-GitHub-Request-Id:
- AAE2:26494:2404BDD:2600886:662F654D
X-Served-By:
- cache-cph2320052-CPH
X-Timer:
- S1714383639.414684,VS0,VE0
X-XSS-Protection:
- 1; mode=block
status:
code: 200
message: OK
version: 1
Loading

0 comments on commit 15c46c8

Please sign in to comment.