Skip to content

Commit

Permalink
Update recorded responses, fix unit test regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Apr 23, 2019
1 parent f0531e8 commit d532949
Show file tree
Hide file tree
Showing 42 changed files with 20,971 additions and 16,063 deletions.
15 changes: 12 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from os import environ
from os.path import join, isfile, dirname, abspath
from os.path import join, isfile, dirname, abspath, exists

import pytest
import yaml
Expand Down Expand Up @@ -89,8 +89,16 @@ def read_func(filename, mode='r'):


@pytest.fixture(scope='session')
def read_yaml(read_fixture_file):
return lambda filename: yaml.safe_load(read_fixture_file(filename))
def read_yaml(fixture_path, read_fixture_file):
def read_or_store(filename, result):
path = fixture_path(filename)
if not exists(path):
# Store the expected result for future if the fixture file is missing
with open(path, 'w') as f:
yaml.safe_dump(result, f)
return yaml.safe_load(read_fixture_file(filename))

return read_or_store


@pytest.fixture(scope='session')
Expand All @@ -114,6 +122,7 @@ def products(api_kwargs, vcr, test_wkt):
test_wkt,
("20151219", "20151228")
)
assert len(products) > 20
return products


Expand Down
294 changes: 181 additions & 113 deletions tests/fixtures/odata_response_full.yml

Large diffs are not rendered by default.

67 changes: 35 additions & 32 deletions tests/fixtures/odata_response_short.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
44517f66-9845-4792-a988-b5ae6e81fd3e:
Creation Date: 2015-12-28 10:50:00.090000
Ingestion Date: 2015-12-28 10:57:13.725000
1f62a176-c980-41dc-b3a1-c735d660c910:
Creation Date: 2019-04-22 17:13:25.951000
Ingestion Date: 2015-11-17 16:56:01.826000
Online: true
date: 2015-12-27 14:22:29
footprint: POLYGON((-58.80274769505742 -4.565257232533263,-58.80535376268811 -5.513960396525286,-57.90315169909761
-5.515947033626909,-57.903151791669515 -5.516014389089381,-57.85874693129081 -5.516044812342758,-57.814323596961835
-5.516142631941845,-57.81432351345917 -5.516075248310466,-57.00018056571297 -5.516633044843839,-57.000180565731384
-5.516700066819259,-56.95603179187787 -5.51666329264377,-56.91188395837315 -5.516693539799448,-56.91188396736038
-5.51662651925904,-56.097209386295305 -5.515947927683427,-56.09720929423562 -5.516014937246069,-56.053056977999596
-5.5159111504805916,-56.00892491028779 -5.515874390220655,-56.00892501130261 -5.515807411549814,-55.10621586418906
-5.513685455771881,-55.108821882251775 -4.6092845892233,-54.20840287327946 -4.606372862374043,-54.21169990975238
-3.658594390979672,-54.214267703869346 -2.710949551849636,-55.15704255065496 -2.7127451087194463,-56.0563616875051
-2.71378646425769,-56.9561852630143 -2.7141556791285275,-57.8999998009875 -2.713837142510183,-57.90079161941062
-3.6180222056692726,-58.800616247288836 -3.616721351843382,-58.80274769505742
-4.565257232533263))
id: 44517f66-9845-4792-a988-b5ae6e81fd3e
md5: 48C5648C2644CE07207B3C943DEDEB44
size: 5854429622
title: S2A_OPER_PRD_MSIL1C_PDMC_20151228T112523_R110_V20151227T142229_20151227T142229
url: https://scihub.copernicus.eu/apihub/odata/v1/Products('44517f66-9845-4792-a988-b5ae6e81fd3e')/$value
8df46c9e-a20c-43db-a19a-4240c2ed3b8b:
Creation Date: 2015-11-21 13:22:01.652000
Ingestion Date: 2015-11-21 13:22:04.992000
Online: false
date: 2015-11-21 10:03:56.675000
footprint: POLYGON((-63.852531 -5.880887,-67.495872 -5.075419,-67.066071 -3.084356,-63.430576
-3.880541,-63.852531 -5.880887))
id: 8df46c9e-a20c-43db-a19a-4240c2ed3b8b
md5: D5E4DF5C38C6E97BF7E7BD540AB21C05
size: 143549851
title: S1A_EW_GRDM_1SDV_20151121T100356_20151121T100429_008701_00C622_A0EC
url: https://scihub.copernicus.eu/apihub/odata/v1/Products('8df46c9e-a20c-43db-a19a-4240c2ed3b8b')/$value
date: 2015-06-03 09:26:24.921000
footprint: POLYGON((-47.310867 42.260288,-47.558411 42.298096,-47.508129 42.476940,-47.259823
42.439095,-47.310867 42.260288))
id: 1f62a176-c980-41dc-b3a1-c735d660c910
md5: EAE42F27C917E1B6C9154A5BE44A4EB6
size: 130006
title: S1A_WV_OCN__2SSH_20150603T092625_20150603T093332_006207_008194_521E
url: https://scihub.copernicus.eu/apihub/odata/v1/Products('1f62a176-c980-41dc-b3a1-c735d660c910')/$value
5618ce1b-923b-4df2-81d9-50b53e5aded9:
Creation Date: 2019-04-22 17:13:26.870000
Ingestion Date: 2015-11-18 08:53:00.497000
Online: true
date: 2015-05-26 08:16:40.873000
footprint: POLYGON((147.846664 3.979146,148.030945 4.018075,148.068436 3.837322,147.884155
3.798364,147.846664 3.979146))
id: 5618ce1b-923b-4df2-81d9-50b53e5aded9
md5: 001E1F3E1978AF61E4E3E011DE31599C
size: 130222
title: S1A_WV_OCN__2SSV_20150526T081641_20150526T082418_006090_007E3E_104C
url: https://scihub.copernicus.eu/apihub/odata/v1/Products('5618ce1b-923b-4df2-81d9-50b53e5aded9')/$value
d8340134-878f-4891-ba4f-4df54f1e3ab4:
Creation Date: 2019-04-22 17:43:54.887000
Ingestion Date: 2015-11-17 23:28:01.852000
Online: true
date: 2015-05-26 21:10:28.984000
footprint: POLYGON((-32.055458 -53.931976,-31.748390 -53.867435,-31.646017 -54.039661,-31.954405
-54.104462,-32.055458 -53.931976))
id: d8340134-878f-4891-ba4f-4df54f1e3ab4
md5: B1D1440F27BF5EB09F2F27A6E49025CB
size: 130102
title: S1A_WV_OCN__2SSV_20150526T211029_20150526T211737_006097_007E78_134A
url: https://scihub.copernicus.eu/apihub/odata/v1/Products('d8340134-878f-4891-ba4f-4df54f1e3ab4')/$value
Loading

0 comments on commit d532949

Please sign in to comment.