Skip to content

Commit

Permalink
#51 modifying the tests(removing the unwanted ones)
Browse files Browse the repository at this point in the history
  • Loading branch information
aanersc committed Oct 12, 2020
1 parent 47897db commit c1f2fdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 31 deletions.
33 changes: 4 additions & 29 deletions geospaas/catalog/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand All @@ -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"]
Expand All @@ -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 '''
Expand Down Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions geospaas/nansat_ingestor/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit c1f2fdc

Please sign in to comment.