From 047c5c8d6ed9171b2cf980ccb4cf1c2b5075250c Mon Sep 17 00:00:00 2001 From: "Krzysztof (Chris) Bernat" Date: Wed, 20 Sep 2017 16:03:56 +0100 Subject: [PATCH] #373 added tests for typo in meta_data/temporal_coverage (cherry picked from commit 6a81e8712ba09ac72ca826b7697933658d25368e) --- test/ds/test_local.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/ds/test_local.py b/test/ds/test_local.py index 4d8323b43..34c9c3714 100644 --- a/test/ds/test_local.py +++ b/test/ds/test_local.py @@ -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',