diff options
author | BonfaceKilz | 2020-07-27 19:48:16 +0300 |
---|---|---|
committer | BonfaceKilz | 2020-07-27 19:48:16 +0300 |
commit | 7732204662bf395eb8ed55b6d26fd208998c1067 (patch) | |
tree | c66d05326ee2dcfb1486b506e28383b5955795f9 /wqflask/tests | |
parent | fea8444fb7b0224fd44711853904822ee8b43f4f (diff) | |
download | genenetwork2-7732204662bf395eb8ed55b6d26fd208998c1067.tar.gz |
Add unittests for WebqtlCaseData
* wqflask/tests/base/test_webqtl_case_data.py: Add it
Diffstat (limited to 'wqflask/tests')
-rw-r--r-- | wqflask/tests/base/test_webqtl_case_data.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/wqflask/tests/base/test_webqtl_case_data.py b/wqflask/tests/base/test_webqtl_case_data.py new file mode 100644 index 00000000..8e8ba482 --- /dev/null +++ b/wqflask/tests/base/test_webqtl_case_data.py @@ -0,0 +1,39 @@ +"""Tests for wqflask/base/webqtlCaseData.py""" +import unittest + +from wqflask import app # Required because of utility.tools in webqtlCaseData.py +from base.webqtlCaseData import webqtlCaseData + +class TestWebqtlCaseData(unittest.TestCase): + """Tests for WebqtlCaseData class""" + + def setUp(self): + self.w = webqtlCaseData(name="Test", + value=0, + variance=0.0, + num_cases=10, + name2="Test2") + + def test_webqtl_case_data_repr(self): + self.assertEqual( + repr(self.w), + "<webqtlCaseData> value=0.000 variance=0.000 ndata=10 name=Test name2=Test2" + ) + + def test_class_outlier(self): + self.assertEqual(self.w.class_outlier, "") + + def test_display_value(self): + self.assertEqual(self.w.display_value, "0.000") + self.w.value = None + self.assertEqual(self.w.display_value, "x") + + def test_display_variance(self): + self.assertEqual(self.w.display_variance, "0.000") + self.w.variance = None + self.assertEqual(self.w.display_variance, "x") + + def test_display_num_cases(self): + self.assertEqual(self.w.display_num_cases, "10") + self.w.num_cases = None + self.assertEqual(self.w.display_num_cases, "x") |