From 48c8e9d9a0feb03288fdc78442c26b027b023df4 Mon Sep 17 00:00:00 2001 From: Jeremy Hooke Date: Thu, 20 Sep 2018 16:34:29 +1000 Subject: [PATCH] Add test for CRS extraction debug method --- cubedash/summary/_extents.py | 2 -- integration_tests/test_page_loads.py | 18 +++++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cubedash/summary/_extents.py b/cubedash/summary/_extents.py index 6fe01f9a0..30f11875e 100644 --- a/cubedash/summary/_extents.py +++ b/cubedash/summary/_extents.py @@ -563,11 +563,9 @@ def get_mapped_crses(*product_names: str, index: Index = None) -> Iterable[Dict] if __name__ == '__main__': - print("CRSes") print(_as_json(list(get_mapped_crses( *(sys.argv[1:] or ['ls8_nbar_scene', 'ls8_nbar_albers']) )))) - print("Extents") print(_as_json(list(get_sample_dataset( *(sys.argv[1:] or ['ls8_nbar_scene', 'ls8_nbar_albers']) )))) diff --git a/integration_tests/test_page_loads.py b/integration_tests/test_page_loads.py index b9283a8ea..397eac102 100644 --- a/integration_tests/test_page_loads.py +++ b/integration_tests/test_page_loads.py @@ -331,15 +331,19 @@ def test_show_summary_cli(clirunner, client: FlaskClient): def test_extent_debugging_method(module_dea_index: Index, client: FlaskClient): - [albers] = _extents.get_sample_dataset('ls7_nbar_scene', index=module_dea_index) - assert albers['id'] is not None - assert albers['dataset_type_ref'] is not None - assert albers['center_time'] is not None - assert albers['footprint'] is not None + [cols] = _extents.get_sample_dataset('ls7_nbar_scene', index=module_dea_index) + assert cols['id'] is not None + assert cols['dataset_type_ref'] is not None + assert cols['center_time'] is not None + assert cols['footprint'] is not None # Can it be serialised without type errors? (for printing) - output_json = _extents._as_json(albers) - assert str(albers['id']) in output_json + output_json = _extents._as_json(cols) + assert str(cols['id']) in output_json + + [cols] = _extents.get_mapped_crses('ls7_nbar_scene', index=module_dea_index) + assert cols['product'] == 'ls7_nbar_scene' + assert cols['crs'] in (28349, 28350, 28351, 28352, 28353, 28354, 28355, 28356) def test_with_timings(client: FlaskClient):