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.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/wqflask/tests/wqflask/marker_regression/test_run_mapping.py b/wqflask/tests/wqflask/marker_regression/test_run_mapping.py
new file mode 100644
index 00000000..0a5bc565
--- /dev/null
+++ b/wqflask/tests/wqflask/marker_regression/test_run_mapping.py
@@ -0,0 +1,36 @@
+import unittest
+from unittest import mock
+from wqflask.marker_regression.run_mapping import get_genofile_samplelist
+
+
+class AttributeSetter:
+ def __init__(self,obj):
+ for k,v in obj.items():
+ setattr(self,k,v)
+
+
+class MockDataSetGroup(AttributeSetter):
+
+ def get_genofiles(self):
+ 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.dataset=AttributeSetter({"group":self.group})
+
+ def tearDown(self):
+ self.dataset=AttributeSetter({"group":{"location":"~/genofiles/g1_file"}})
+
+
+ def test_get_genofile_samplelist(self):
+ #location true and sample list true
+
+ results_1=get_genofile_samplelist(self.dataset)
+ self.assertEqual(results_1,["S1","S2","S3","S4"])
+ #return empty array
+ self.group.genofile="~/genofiles/g2_file"
+ result_2=get_genofile_samplelist(self.dataset)
+ self.assertEqual(result_2,[])
+
+
+