From f6c8f30528969bf916bff4290c55f0866f69e8ea Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 29 Apr 2021 17:38:08 +0300 Subject: tests: unit: test_data_set: Remove unused mock --- wqflask/tests/unit/base/test_data_set.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'wqflask/tests/unit/base/test_data_set.py') diff --git a/wqflask/tests/unit/base/test_data_set.py b/wqflask/tests/unit/base/test_data_set.py index 96563a16..ab0dc51c 100644 --- a/wqflask/tests/unit/base/test_data_set.py +++ b/wqflask/tests/unit/base/test_data_set.py @@ -31,14 +31,12 @@ class TestDataSetTypes(unittest.TestCase): def tearDown(self): self.app_context.pop() - @mock.patch('base.data_set.g') - def test_data_set_type(self, db_mock): + def test_data_set_type(self): """Test that DatasetType returns correctly if the Redis Instance is not empty and the name variable exists in the dictionary """ with app.app_context(): - db_mock.get = mock.Mock() redis_mock = mock.Mock() redis_mock.get.return_value = self.test_dataset self.assertEqual(DatasetType(redis_mock) -- cgit v1.2.3 From e2b02fc85201320b1ae1d96ec4f598be1f6602c9 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 29 Apr 2021 20:29:38 +0300 Subject: tests: test_data_set: Update test --- wqflask/tests/unit/base/test_data_set.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'wqflask/tests/unit/base/test_data_set.py') diff --git a/wqflask/tests/unit/base/test_data_set.py b/wqflask/tests/unit/base/test_data_set.py index ab0dc51c..ee5d6f06 100644 --- a/wqflask/tests/unit/base/test_data_set.py +++ b/wqflask/tests/unit/base/test_data_set.py @@ -87,8 +87,7 @@ class TestDataSetTypes(unittest.TestCase): '"B139_K_1206_M": "ProbeSet", ' '"B139_K_1206_R": "ProbeSet", ' '"Test": "ProbeSet"}')) - - db_mock.db.execute.assert_called_with( + db_mock.db.execute.assert_called_once_with( ("SELECT ProbeSetFreeze.Id FROM ProbeSetFreeze " + "WHERE ProbeSetFreeze.Name = \"Test\" ") ) -- cgit v1.2.3