From c1f2fdc34c2db5f42deebca93964c56e53af583b Mon Sep 17 00:00:00 2001 From: aanersc Date: Fri, 25 Sep 2020 15:04:48 +0200 Subject: [PATCH] #51 modifying the tests(removing the unwanted ones) --- geospaas/catalog/tests.py | 33 ++++--------------------------- geospaas/nansat_ingestor/tests.py | 4 ++-- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/geospaas/catalog/tests.py b/geospaas/catalog/tests.py index 77a3775b..aaea4e26 100644 --- a/geospaas/catalog/tests.py +++ b/geospaas/catalog/tests.py @@ -122,19 +122,6 @@ def test_entry_id_is_correct(self): ds.full_clean() self.assertEqual(ds.entry_id, id) - def test_search_datasets(self): - ''' Shall add one parameter to the first dataset - shall find one Dataset without sst ''' - dataset1 = Dataset.objects.get(pk=1) - p = Parameter.objects.get( - standard_name='sea_surface_temperature') - dp = DatasetParameter(dataset=dataset1, parameter=p) - dp.save() - dsearch = Dataset.objects.filter( source__instrument__short_name = - 'MODIS') - dsearch = dsearch.exclude(datasetparameter__parameter__short_name = - 'SST' ) - self.assertEqual(dsearch.count(), 1) class DatasetURITests(TestCase): @@ -152,20 +139,6 @@ def test_DatasetURI_created(self, mock_isfile): self.assertEqual(dsuri.uri, uri) - -class DatasetParameterTests(TestCase): - - fixtures = ["vocabularies", "catalog"] - - def test_add_sar_sigma0(self): - ds = Dataset.objects.get(pk=1) - p = Parameter.objects.get( - standard_name='surface_backwards_scattering_coefficient_of_radar_wave', - short_name='sigma0') - dp = DatasetParameter(dataset=ds, parameter=p) - dp.save() - self.assertEqual(dp.parameter.short_name, 'sigma0') - class DatasetRelationshipTests(TestCase): fixtures = ["vocabularies", "catalog"] @@ -181,6 +154,7 @@ def test_variable(self): dr.save() self.assertEqual(dr.child.source, dr.parent.source) + class GeographicLocationTests(TestCase): def test_geographiclocation(self): ''' Shall create GeographicLocation instance ''' @@ -210,17 +184,18 @@ def test__reproduce__not_null_constraint_failed(self): self.assertFalse(created) # Conclusion: db can't handle numbers with too many decimals (NOT NULL constraint failed) -class PersonnelTests(TestCase): +class PersonnelTests(TestCase): ''' We should add user admin with, e.g., with the Personnel model. Skip testing before that is in place ''' pass -class RoleTests(TestCase): +class RoleTests(TestCase): pass + class SourceTests(TestCase): fixtures = ["vocabularies"] diff --git a/geospaas/nansat_ingestor/tests.py b/geospaas/nansat_ingestor/tests.py index 10807255..616ad1c2 100644 --- a/geospaas/nansat_ingestor/tests.py +++ b/geospaas/nansat_ingestor/tests.py @@ -174,7 +174,7 @@ def test_getorcreate_localfile_filtering_base_on_parameter(self): self.predefined_band_metadata_dict[2]['standard_name']) def test_dont_add_longitude_latitude(self): - """ shall not add latitude and longitude into DatasetParameter table """ + """ shall not add latitude and longitude into Parameters of Dataset table """ uri = 'file://localhost/some/folder/filename.ext' ds0, _ = Dataset.objects.get_or_create(uri) ds_params_standard_names = ds0.parameters.values_list('standard_name', flat=True) @@ -184,7 +184,7 @@ def test_dont_add_longitude_latitude(self): self.assertNotIn('latidtude', ds_params_standard_names) def test_add_sigma0_gamma0(self): - """ shall add both sigma0 and gamma0 with same standard name into DatasetParameter table """ + """ shall add both sigma0 and gamma0 with same standard name into Parameters of Dataset table """ uri = 'file://localhost/some/folder/filename.ext' ds0, _ = Dataset.objects.get_or_create(uri) ds_params_standard_names = ds0.parameters.values_list('standard_name', flat=True)