Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
#373 added tests for typo in meta_data/temporal_coverage
Browse files Browse the repository at this point in the history
(cherry picked from commit 6a81e87)
  • Loading branch information
Krzysztof (Chris) Bernat authored and kbernat committed Sep 20, 2017
1 parent 2c88d8e commit 047c5c8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/ds/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,27 @@ def test_load_old_datasource_from_json_dict(self):
self.assertListEqual([var.get('name') for var in data_source.variables_info],
test_data.get('meta_data').get('variables'))

test_data = {
'name': 'local.test_name',
'meta_data': {
'temporal_covrage': "2001-01-01 00:00:00,2001-01-31 23:59:59",
'spatial_coverage': "-180,-90,180,90",
'variables': ['var_test_1', 'var_test_2'],
},
"meta_info": {
},
'files': [['file_1', '2002-02-01 00:00:00', '2002-02-01 23:59:59'],
['file_2', '2002-03-01 00:00:00', '2002-03-01 23:59:59']]
}
data_source = LocalDataSource.from_json_dict(json_dict=test_data, data_store=self.data_store)
self.assertIsNotNone(data_source)
self.assertEqual(data_source.temporal_coverage(),
TimeRangeLike.convert(test_data.get('meta_data').get('temporal_covrage')))
self.assertEqual(data_source.spatial_coverage(),
PolygonLike.convert(test_data.get('meta_data').get('spatial_coverage')))
self.assertListEqual([var.get('name') for var in data_source.variables_info],
test_data.get('meta_data').get('variables'))

def test_load_datasource_from_json_dict(self):
test_data = {
'name': 'local.test_name2',
Expand Down

0 comments on commit 047c5c8

Please sign in to comment.