Skip to content

Commit

Permalink
#40 correction or modification of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aanersc committed Sep 29, 2020
1 parent c216a34 commit 2b17e92
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tests/test_crawlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ class FTPCrawlerTestCase(unittest.TestCase):
def emulate_cwd_of_ftp(self, name):
"""passes in the case of "", ".." or "folder_name" in order to resemble the behavior of cwd
of ftplib. Otherwise (encountering a filename) raise the proper exception """
if name not in ["..", "folder_name", ""]:
if name not in ("..", "folder_name", ""):
raise ftplib.error_perm

@mock.patch('geospaas_harvesting.crawlers.ftplib.FTP', autospec=True)
Expand Down
18 changes: 9 additions & 9 deletions tests/test_ingesters.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,9 @@ def test_function_get_normalized_attributes_ceda(self):
ingester = ingesters.URLNameIngester()
normalized_attributes = ingester._get_normalized_attributes(input_url)
self.assertCountEqual(list(normalized_attributes.keys()),
ingester.DATASET_CUMULATIVE_PARAMETER_NAMES +
ingester.DATASET_PARAMETER_NAMES +
['geospaas_service_name', 'geospaas_service', 'entry_id'])
ingester.DATASET_CUMULATIVE_PARAMETER_NAMES.union(
ingester.DATASET_PARAMETER_NAMES).union(
{'geospaas_service_name', 'geospaas_service', 'entry_id'}))
self.assertNotIn(None, normalized_attributes.values())

def test_function_get_normalized_attributes_remss(self):
Expand All @@ -734,9 +734,9 @@ def test_function_get_normalized_attributes_remss(self):
ingester = ingesters.URLNameIngester()
normalized_attributes = ingester._get_normalized_attributes(input_url)
self.assertCountEqual(list(normalized_attributes.keys()),
ingester.DATASET_CUMULATIVE_PARAMETER_NAMES +
ingester.DATASET_PARAMETER_NAMES +
['geospaas_service_name', 'geospaas_service', 'entry_id'])
ingester.DATASET_CUMULATIVE_PARAMETER_NAMES.union(
ingester.DATASET_PARAMETER_NAMES).union(
{'geospaas_service_name', 'geospaas_service', 'entry_id'}))
self.assertNotIn(None, normalized_attributes.values())

def test_function_get_normalized_attributes_jaxa(self):
Expand All @@ -748,9 +748,9 @@ def test_function_get_normalized_attributes_jaxa(self):
ingester = ingesters.URLNameIngester()
normalized_attributes = ingester._get_normalized_attributes(input_url)
self.assertCountEqual(list(normalized_attributes.keys()),
ingester.DATASET_CUMULATIVE_PARAMETER_NAMES +
ingester.DATASET_PARAMETER_NAMES +
['geospaas_service_name', 'geospaas_service', 'entry_id'])
ingester.DATASET_CUMULATIVE_PARAMETER_NAMES.union(
ingester.DATASET_PARAMETER_NAMES).union(
{'geospaas_service_name', 'geospaas_service', 'entry_id'}))
self.assertNotIn(None, normalized_attributes.values())


Expand Down

0 comments on commit 2b17e92

Please sign in to comment.