diff options
author | Arun Isaac | 2023-12-30 05:17:17 +0000 |
---|---|---|
committer | Arun Isaac | 2023-12-30 05:17:17 +0000 |
commit | 8536431f9c367c55d2ea138ab24b2d12e98f7c81 (patch) | |
tree | 1d7d272066ee675065e4d1e89fa37fdb5293e101 /gn2/tests/wqflask/show_trait | |
parent | 21d6de22641cb1b540e03cb963d12593dab16046 (diff) | |
download | genenetwork2-8536431f9c367c55d2ea138ab24b2d12e98f7c81.tar.gz |
Namespace mock paths under gn2.
Diffstat (limited to 'gn2/tests/wqflask/show_trait')
-rw-r--r-- | gn2/tests/wqflask/show_trait/test_show_trait.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gn2/tests/wqflask/show_trait/test_show_trait.py b/gn2/tests/wqflask/show_trait/test_show_trait.py index 97618d31..51b0c82c 100644 --- a/gn2/tests/wqflask/show_trait/test_show_trait.py +++ b/gn2/tests/wqflask/show_trait/test_show_trait.py @@ -39,10 +39,10 @@ def test_check_if_attr_exists(trait, id_type, expected): def test_get_ncbi_summary_request(mocker): trait = TraitObject({"geneid": "id"}) - mocker.patch("wqflask.show_trait.show_trait.check_if_attr_exists", + mocker.patch("gn2.wqflask.show_trait.show_trait.check_if_attr_exists", return_value=True) mock_get = mocker.patch( - "wqflask.show_trait.show_trait.requests.get", + "gn2.wqflask.show_trait.show_trait.requests.get", return_value=TraitObject({"content": """{ "result":{ "id":{ @@ -143,7 +143,7 @@ class TestTraits(unittest.TestCase): self.assertEqual(results, "this is a descriptionN/A") self.assertEqual(results_no_unit, "value") - @mock.patch("wqflask.show_trait.show_trait.database_connection") + @mock.patch("gn2.wqflask.show_trait.show_trait.database_connection") def test_get_nearest_marker(self, mock_db): """test for getting nearest marker with non-empty db""" conn = mock.MagicMock() @@ -170,7 +170,7 @@ class TestTraits(unittest.TestCase): self.assertEqual(results_with_item_db, "Geno1") - @mock.patch("wqflask.show_trait.show_trait.database_connection") + @mock.patch("gn2.wqflask.show_trait.show_trait.database_connection") def test_get_nearest_marker_empty_db(self, mock_db): """test for getting nearest marker with empty db""" conn = mock.MagicMock() @@ -187,7 +187,7 @@ class TestTraits(unittest.TestCase): cursor.execute.assert_called_once() self.assertEqual(results_empty_db, "") - @mock.patch("wqflask.show_trait.show_trait.get_scales_from_genofile") + @mock.patch("gn2.wqflask.show_trait.show_trait.get_scales_from_genofile") def test_get_genotype_scales_with_genofile_is_list(self, mock_get_scales): """test for getting genotype scales with genofile as list """ # where genofile is instance of list @@ -211,7 +211,7 @@ class TestTraits(unittest.TestCase): mock_get_scales.assert_has_calls(multiple_calls) self.assertEqual(results, expected_results) - @mock.patch("wqflask.show_trait.show_trait.get_scales_from_genofile") + @mock.patch("gn2.wqflask.show_trait.show_trait.get_scales_from_genofile") def test_genotype_scales_with_genofile_other(self, mock_get_scales): """test for getting genotype scales with genofile as a string""" file_location = "~/another_file_location" @@ -220,7 +220,7 @@ class TestTraits(unittest.TestCase): self.assertEqual(get_genotype_scales(file_location), expected_results) mock_get_scales.assert_called_once_with(file_location) - @mock.patch("wqflask.show_trait.show_trait.locate_ignore_error") + @mock.patch("gn2.wqflask.show_trait.show_trait.locate_ignore_error") def test_get_scales_from_genofile_found(self, mock_ignore_location): """"add test for get scales from genofile where file is found""" mock_ignore_location.return_value = True @@ -245,7 +245,7 @@ class TestTraits(unittest.TestCase): result2 = get_scales_from_genofile(file_location) self.assertEqual([['morgan', 'cM']], result2) - @mock.patch("wqflask.show_trait.show_trait.locate_ignore_error") + @mock.patch("gn2.wqflask.show_trait.show_trait.locate_ignore_error") def test_get_scales_from_genofile_not_found(self, mock_location_ignore): mock_location_ignore.return_value = False |