aboutsummaryrefslogtreecommitdiff
path: root/wqflask/tests
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/tests')
-rw-r--r--wqflask/tests/wqflask/marker_regression/test_run_mapping.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/wqflask/tests/wqflask/marker_regression/test_run_mapping.py b/wqflask/tests/wqflask/marker_regression/test_run_mapping.py
index 0a5bc565..61bc8a1d 100644
--- a/wqflask/tests/wqflask/marker_regression/test_run_mapping.py
+++ b/wqflask/tests/wqflask/marker_regression/test_run_mapping.py
@@ -1,7 +1,7 @@
import unittest
from unittest import mock
from wqflask.marker_regression.run_mapping import get_genofile_samplelist
-
+from wqflask.marker_regression.run_mapping import geno_db_exists
class AttributeSetter:
def __init__(self,obj):
@@ -15,7 +15,7 @@ class MockDataSetGroup(AttributeSetter):
return [{"location":"~/genofiles/g1_file","sample_list":["S1","S2","S3","S4"]}]
class TestRunMapping(unittest.TestCase):
def setUp(self):
- self.group=MockDataSetGroup({"genofile":"~/genofiles/g1_file"})
+ self.group=MockDataSetGroup({"genofile":"~/genofiles/g1_file","name":"GP1_"})
self.dataset=AttributeSetter({"group":self.group})
def tearDown(self):
@@ -32,5 +32,21 @@ class TestRunMapping(unittest.TestCase):
result_2=get_genofile_samplelist(self.dataset)
self.assertEqual(result_2,[])
+ @mock.patch("wqflask.marker_regression.run_mapping.data_set")
+ def test_geno_db_exists(self,mock_data_set):
+ # mock_data_set.create_dataset_side_effect=None
+ mock_data_set.create_dataset.side_effect=[AttributeSetter({}),Exception()]
+ results_no_error=geno_db_exists(self.dataset)
+ results_with_error=geno_db_exists(self.dataset)
+
+ self.assertEqual(mock_data_set.create_dataset.call_count,2)
+ self.assertEqual(results_with_error,"False")
+ self.assertEqual(results_no_error,"True")
+
+
+
+
+
+