aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorBonfaceKilz2020-07-23 02:52:41 +0300
committerBonfaceKilz2020-07-24 03:47:44 +0300
commit16aaf9885971993863b5e2e8a1b99f8479e2bbb9 (patch)
treed1fed56a44dab494966ae4cd63bc1c8a1a15df7a /wqflask
parent1a0380b9f778600f4ed0838a2dfaf4fc3d7bc768 (diff)
downloadgenenetwork2-16aaf9885971993863b5e2e8a1b99f8479e2bbb9.tar.gz
Add unittests for *base/data_set*
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/tests/base/test_data_set.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/wqflask/tests/base/test_data_set.py b/wqflask/tests/base/test_data_set.py
new file mode 100644
index 00000000..44a54c7e
--- /dev/null
+++ b/wqflask/tests/base/test_data_set.py
@@ -0,0 +1,35 @@
+import unittest
+import mock
+
+from wqflask import app
+
+from base.data_set import DatasetType
+
+
+class TestDataSetTypes(unittest.TestCase):
+ def setUp(self):
+ self.app_context = app.app_context()
+ self.app_context.push()
+
+ def tearDown(self):
+ self.app_context.pop()
+
+ @mock.patch('base.data_set.g')
+ def test_data_set_type(self, db_mock):
+ with app.app_context():
+ db_mock.get = mock.Mock()
+ r = mock.Mock()
+ r.get.return_value = """
+ {
+ "AD-cases-controls-MyersGeno": "Geno",
+ "AD-cases-controls-MyersPublish": "Publish",
+ "AKXDGeno": "Geno",
+ "AXBXAGeno": "Geno",
+ "AXBXAPublish": "Publish",
+ "Aging-Brain-UCIPublish": "Publish",
+ "All Phenotypes": "Publish",
+ "B139_K_1206_M": "ProbeSet",
+ "B139_K_1206_R": "ProbeSet"
+ }
+ """
+ self.assertEqual(DatasetType(r)("All Phenotypes"), "Publish")