aboutsummaryrefslogtreecommitdiff
path: root/wqflask/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/tests/unit')
-rw-r--r--wqflask/tests/unit/base/test_mrna_assay_tissue_data.py22
-rw-r--r--wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py14
2 files changed, 22 insertions, 14 deletions
diff --git a/wqflask/tests/unit/base/test_mrna_assay_tissue_data.py b/wqflask/tests/unit/base/test_mrna_assay_tissue_data.py
index 7a21124a..ecaa9def 100644
--- a/wqflask/tests/unit/base/test_mrna_assay_tissue_data.py
+++ b/wqflask/tests/unit/base/test_mrna_assay_tissue_data.py
@@ -49,3 +49,25 @@ def test_mrna_assay_tissue_data_initialisation(mocker, gene_symbols,
cursor.fetchall.return_value = sql_fetch_all_results
MrnaAssayTissueData(conn=mock_conn, gene_symbols=gene_symbols)
cursor.execute.assert_called_with(*expected_query)
+
+
+def test_get_trait_symbol_and_tissue_values(mocker):
+ """Test for getting trait symbol and tissue_values"""
+ mock_conn = mocker.MagicMock()
+ with mock_conn.cursor() as cursor:
+ cursor.fetchall.side_effect = [
+ (("k1", "203",
+ "112", "xy", "20.11",
+ "Sample Description",
+ "Sample Probe Target Description"),),
+ (("k1", "v1"),
+ ("k2", "v2"),
+ ("k3", "v3")),
+ ]
+ _m = MrnaAssayTissueData(conn=mock_conn,
+ gene_symbols=["k1", "k2", "k3"])
+ assert _m.get_symbol_values_pairs() == {
+ "k1": ["v1"],
+ "k2": ["v2"],
+ "k3": ["v3"],
+ }
diff --git a/wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py b/wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py
index 4060d0e5..bb07d41e 100644
--- a/wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py
+++ b/wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py
@@ -19,17 +19,3 @@ def test_tissue_corr_computation(mocker):
primary_values=primary_values, target_values=target_values,
corr_method="pearson")
assert len(results) == 3
-
-
- @mock.patch("wqflask.correlation.correlation_functions.MrnaAssayTissueData")
- def test_get_trait_symbol_and_tissue_values(self, mock_class):
- """test for getting trait symbol and tissue_values"""
- mock_class_instance = mock_class.return_value
- mock_class_instance.gene_symbols = ["k1", "k2", "k3"]
- mock_class_instance.get_symbol_values_pairs.return_value = {
- "k1": ["v1", "v2", "v3"], "k2": ["v2", "v3"], "k3": ["k3"]}
- results = get_trait_symbol_and_tissue_values(
- symbol_list=["k1", "k2", "k3"])
- mock_class.assert_called_with(gene_symbols=['k1', 'k2', 'k3'])
- self.assertEqual({"k1": ["v1", "v2", "v3"], "k2": [
- "v2", "v3"], "k3": ["k3"]}, results)