aboutsummaryrefslogtreecommitdiff
path: root/wqflask/tests/base/test_data_set.py
diff options
context:
space:
mode:
authorzsloan2020-10-19 13:43:32 -0500
committerGitHub2020-10-19 13:43:32 -0500
commit8eaae7296e2d66726975ddba0de8aecae256e63b (patch)
tree5505b932195a454c1ada10677f0e76faba6b588f /wqflask/tests/base/test_data_set.py
parent5fdb3b83566516782542d04b92a5be97f41c2330 (diff)
parent3f242af74af814d9344e1e80c5f94914c6d9b621 (diff)
downloadgenenetwork2-8eaae7296e2d66726975ddba0de8aecae256e63b.tar.gz
Merge branch 'testing' into scroller_testing
Diffstat (limited to 'wqflask/tests/base/test_data_set.py')
-rw-r--r--wqflask/tests/base/test_data_set.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/wqflask/tests/base/test_data_set.py b/wqflask/tests/base/test_data_set.py
index 94780a5d..dd7f5051 100644
--- a/wqflask/tests/base/test_data_set.py
+++ b/wqflask/tests/base/test_data_set.py
@@ -66,7 +66,7 @@ class TestDataSetTypes(unittest.TestCase):
@mock.patch('base.data_set.g')
def test_set_dataset_key_mrna(self, db_mock):
with app.app_context():
- db_mock.db.execute.return_value = [1, 2, 3]
+ db_mock.db.execute.return_value.fetchone.return_value = [1, 2, 3]
redis_mock = mock.Mock()
redis_mock.get.return_value = self.test_dataset
data_set = DatasetType(redis_mock)
@@ -84,7 +84,7 @@ class TestDataSetTypes(unittest.TestCase):
@mock.patch('base.data_set.g')
def test_set_dataset_key_pheno(self, db_mock):
with app.app_context():
- db_mock.db.execute.return_value = [1, 2, 3]
+ db_mock.db.execute.return_value.fetchone.return_value = [1, 2, 3]
redis_mock = mock.Mock()
redis_mock.get.return_value = self.test_dataset
data_set = DatasetType(redis_mock)
@@ -93,7 +93,6 @@ class TestDataSetTypes(unittest.TestCase):
redis_mock.set.assert_called_once_with(
"dataset_structure",
'{"Aging-Brain-UCIPublish": "Publish", "AKXDGeno": "Geno", "B139_K_1206_M": "ProbeSet", "AD-cases-controls-MyersGeno": "Geno", "AD-cases-controls-MyersPublish": "Publish", "All Phenotypes": "Publish", "Test": "Publish", "AXBXAPublish": "Publish", "B139_K_1206_R": "ProbeSet", "AXBXAGeno": "Geno"}')
- expected_db_call = """"""
db_mock.db.execute.assert_called_with(
("SELECT InfoFiles.GN_AccesionId " +
"FROM InfoFiles, PublishFreeze, InbredSet " +
@@ -105,7 +104,7 @@ class TestDataSetTypes(unittest.TestCase):
@mock.patch('base.data_set.g')
def test_set_dataset_other_pheno(self, db_mock):
with app.app_context():
- db_mock.db.execute.return_value = [1, 2, 3]
+ db_mock.db.execute.return_value.fetchone.return_value = [1, 2, 3]
redis_mock = mock.Mock()
redis_mock.get.return_value = self.test_dataset
data_set = DatasetType(redis_mock)
@@ -114,7 +113,6 @@ class TestDataSetTypes(unittest.TestCase):
redis_mock.set.assert_called_once_with(
"dataset_structure",
'{"Aging-Brain-UCIPublish": "Publish", "AKXDGeno": "Geno", "B139_K_1206_M": "ProbeSet", "AD-cases-controls-MyersGeno": "Geno", "AD-cases-controls-MyersPublish": "Publish", "All Phenotypes": "Publish", "Test": "Publish", "AXBXAPublish": "Publish", "B139_K_1206_R": "ProbeSet", "AXBXAGeno": "Geno"}')
- expected_db_call = """"""
db_mock.db.execute.assert_called_with(
("SELECT PublishFreeze.Name " +
"FROM PublishFreeze, InbredSet " +
@@ -125,7 +123,7 @@ class TestDataSetTypes(unittest.TestCase):
@mock.patch('base.data_set.g')
def test_set_dataset_geno(self, db_mock):
with app.app_context():
- db_mock.db.execute.return_value = [1, 2, 3]
+ db_mock.db.execute.return_value.fetchone.return_value = [1, 2, 3]
redis_mock = mock.Mock()
redis_mock.get.return_value = self.test_dataset
data_set = DatasetType(redis_mock)