aboutsummaryrefslogtreecommitdiff
path: root/wqflask/tests
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/tests')
-rw-r--r--wqflask/tests/integration/test_markdown_routes.py21
-rw-r--r--wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py20
2 files changed, 20 insertions, 21 deletions
diff --git a/wqflask/tests/integration/test_markdown_routes.py b/wqflask/tests/integration/test_markdown_routes.py
deleted file mode 100644
index 5e3e5045..00000000
--- a/wqflask/tests/integration/test_markdown_routes.py
+++ /dev/null
@@ -1,21 +0,0 @@
-"Integration tests for markdown routes"
-import unittest
-
-from bs4 import BeautifulSoup
-
-from wqflask import app
-
-
-class TestGenMenu(unittest.TestCase):
- """Tests for glossary"""
-
- def setUp(self):
- self.app = app.test_client()
-
- def tearDown(self):
- pass
-
- def test_glossary_page(self):
- """Test that the glossary page is rendered properly"""
- response = self.app.get('/glossary', follow_redirects=True)
- pass
diff --git a/wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py b/wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py
index 2bbeab1f..a8cf6006 100644
--- a/wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py
+++ b/wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py
@@ -1,10 +1,30 @@
+"""module contains tests for correlation functions"""
+
import unittest
from unittest import mock
+
from wqflask.correlation.correlation_functions import get_trait_symbol_and_tissue_values
from wqflask.correlation.correlation_functions import cal_zero_order_corr_for_tiss
class TestCorrelationFunctions(unittest.TestCase):
+ """test for correlation helper functions"""
+
+ @mock.patch("wqflask.correlation.correlation_functions.compute_corr_coeff_p_value")
+ def test_tissue_corr_computation(self, mock_tiss_corr_computation):
+ """test for cal_zero_order_corr_for_tiss"""
+
+ primary_values = [9.288, 9.313, 8.988, 9.660, 8.21]
+ target_values = [9.586, 8.498, 9.362, 8.820, 8.786]
+
+ mock_tiss_corr_computation.return_value = (0.51, 0.7)
+
+ results = cal_zero_order_corr_for_tiss(primary_values, target_values)
+ mock_tiss_corr_computation.assert_called_once_with(
+ primary_values=primary_values, target_values=target_values,
+ corr_method="pearson")
+
+ self.assertEqual(len(results), 3)
@mock.patch("wqflask.correlation.correlation_functions.MrnaAssayTissueData")
def test_get_trait_symbol_and_tissue_values(self, mock_class):