aboutsummaryrefslogtreecommitdiff
path: root/wqflask/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/tests/unit')
-rw-r--r--wqflask/tests/unit/wqflask/api/test_correlation.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/wqflask/tests/unit/wqflask/api/test_correlation.py b/wqflask/tests/unit/wqflask/api/test_correlation.py
index 11c7d82b..9fa848a4 100644
--- a/wqflask/tests/unit/wqflask/api/test_correlation.py
+++ b/wqflask/tests/unit/wqflask/api/test_correlation.py
@@ -108,10 +108,12 @@ class TestCorrelations(unittest.TestCase):
results_pearsonr=get_sample_r_and_p_values(this_trait=this_trait,this_dataset={},target_vals=target_vals,target_dataset=target_dataset,type="pearson")
results_spearmanr=get_sample_r_and_p_values(this_trait=this_trait,this_dataset={},target_vals=target_vals,target_dataset=target_dataset,type="spearman")
results_num_overlap=get_sample_r_and_p_values(this_trait=this_trait,this_dataset={},target_vals=target_vals,target_dataset=target_dataset,type="pearson")
- self.assertEqual(mock_normalize.call_count,3)
-
- self.assertEqual(results_pearsonr,[-0.21618688834430866, 0.680771605997119, 6])
- self.assertEqual(results_spearmanr,[-0.11595420713048969, 0.826848213385815, 6])
+ expected_pearsonr=[-0.21618688834430866, 0.680771605997119, 6]
+ expected_spearmanr=[-0.11595420713048969, 0.826848213385815, 6]
+ for i,val in enumerate(expected_pearsonr):
+ self.assertAlmostEqual(val,results_pearsonr[i])
+ for i,val in enumerate(expected_spearmanr):
+ self.assertAlmostEqual(val,results_spearmanr[i])
self.assertEqual(results_num_overlap,None)
@mock.patch("wqflask.api.correlation.do_literature_correlation_for_all_traits")
@@ -133,7 +135,6 @@ class TestCorrelations(unittest.TestCase):
-