diff options
author | Alexander Kabui | 2021-04-06 23:11:22 +0300 |
---|---|---|
committer | Alexander Kabui | 2021-04-06 23:11:22 +0300 |
commit | 8ce82f5b6cccc015c38a728864c63c026fe6a3a0 (patch) | |
tree | 3b5976a8c07c93e6c9318c4464596b0763e4f11a /tests/integration/test_datasets.py | |
parent | a1fcc30e84bd7201c852faf6f6a622face646ef8 (diff) | |
download | genenetwork3-8ce82f5b6cccc015c38a728864c63c026fe6a3a0.tar.gz |
add mock db for tests
Diffstat (limited to 'tests/integration/test_datasets.py')
-rw-r--r-- | tests/integration/test_datasets.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/integration/test_datasets.py b/tests/integration/test_datasets.py index 34b7669..f97d970 100644 --- a/tests/integration/test_datasets.py +++ b/tests/integration/test_datasets.py @@ -28,12 +28,14 @@ class DatasetIntegrationTests(TestCase): self.assertEqual(response.status_code, 200) @mock.patch("gn3.api.datasets.get_traits_data") - def test_fetch_traits_data(self, mock_get_trait_data): + @mock.patch("gn3.api.datasets.database_connector") + def test_fetch_traits_data(self, mock_db, mock_get_trait_data): """Test api/dataset/fetch_traits_data/d_name/d_type""" mock_get_trait_data.return_value = {} + mock_db.return_value = (mock.Mock(), mock.Mock()) response = self.app.get( - "/api/dataset/fetch_traits_data/Aging-Brain-UCIPublish/Publish") + "/api/dataset/fetch_traits_data/Aging-Brain-UCIPublish/Publish", follow_redirects=True) self.assertEqual(response.status_code, 200) self.assertEqual(response.get_json(), {"results": {}}) |