Skip to content

Commit

Permalink
Add test for CRS extraction debug method
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyh committed Sep 20, 2018
1 parent faaa304 commit 48c8e9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 0 additions & 2 deletions cubedash/summary/_extents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
))))
18 changes: 11 additions & 7 deletions integration_tests/test_page_loads.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 48c8e9d

Please sign in to comment.