From 9dff9888f81b7eec0e698466518ce4cb55b8bd8c Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 3 Mar 2021 10:58:55 +0300 Subject: Delete "lookup_file" procedure --- tests/unit/test_file_utils.py | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/test_file_utils.py b/tests/unit/test_file_utils.py index 7f4d83d..af86ba8 100644 --- a/tests/unit/test_file_utils.py +++ b/tests/unit/test_file_utils.py @@ -8,7 +8,6 @@ from unittest import mock from gn3.file_utils import extract_uploaded_file from gn3.file_utils import get_dir_hash from gn3.file_utils import jsonfile_to_dict -from gn3.file_utils import lookup_file @dataclass @@ -32,34 +31,6 @@ class TestFileUtils(unittest.TestCase): get_dir_hash, "/non-existent-file") - @mock.patch("os.path.isfile") - @mock.patch.dict(os.environ, {"GENENETWORK_FILES": "/tmp/"}) - def test_lookup_genotype_file_exists(self, mock_isfile): - """Test whether genotype file exists if file is present""" - mock_isfile.return_value = True - self.assertEqual(lookup_file("GENENETWORK_FILES", - "genotype_files", "genotype.txt"), - "/tmp/genotype_files/genotype.txt") - - @mock.patch("os.path.isfile") - @mock.patch.dict(os.environ, {"GENENETWORK_FILES": "/tmp"}) - def test_lookup_genotype_file_does_not_exist(self, mock_isfile): - """Test whether genotype file exists if file is absent""" - mock_isfile.return_value = False - self.assertRaises(FileNotFoundError, - lookup_file, - "GENENETWORK_FILES", - "genotype_files", - "genotype.txt") - - def test_lookup_genotype_file_env_does_not_exist(self): - """Test whether genotype file exists if GENENETWORK_FILES is absent""" - self.assertRaises(FileNotFoundError, - lookup_file, - "GENENETWORK_FILES", - "genotype_files", - "genotype.txt") - def test_jsonfile_to_dict(self): """Test that a json file is parsed correctly""""" json_file = os.path.join(os.path.dirname(__file__), -- cgit v1.2.3