From 204a308be0f741726b9a620d88fbc22b22124c81 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 29 Dec 2023 18:55:37 +0000 Subject: Namespace all modules under gn2. We move all modules under a gn2 directory. This is important for "correct" packaging and deployment as a Guix service. --- .../tests/unit/base/test_mrna_assay_tissue_data.py | 81 ---------------------- 1 file changed, 81 deletions(-) delete mode 100644 wqflask/tests/unit/base/test_mrna_assay_tissue_data.py (limited to 'wqflask/tests/unit/base/test_mrna_assay_tissue_data.py') diff --git a/wqflask/tests/unit/base/test_mrna_assay_tissue_data.py b/wqflask/tests/unit/base/test_mrna_assay_tissue_data.py deleted file mode 100644 index c43fb4b6..00000000 --- a/wqflask/tests/unit/base/test_mrna_assay_tissue_data.py +++ /dev/null @@ -1,81 +0,0 @@ -import pytest -from base.mrna_assay_tissue_data import MrnaAssayTissueData - - -@pytest.mark.parametrize( - ('gene_symbols', 'expected_query', 'sql_fetch_all_results'), - ( - (None, - (("SELECT t.Symbol, t.GeneId, t.DataId, " - "t.Chr, t.Mb, t.description, " - "t.Probe_Target_Description " - "FROM (SELECT Symbol, " - "max(Mean) AS maxmean " - "FROM TissueProbeSetXRef WHERE " - "TissueProbeSetFreezeId=1 AND " - "Symbol != '' AND Symbol IS NOT " - "Null GROUP BY Symbol) " - "AS x INNER JOIN TissueProbeSetXRef " - "AS t ON t.Symbol = x.Symbol " - "AND t.Mean = x.maxmean"),), - (("symbol", "gene_id", - "data_id", "chr", "mb", - "description", - "probe_target_description"),)), - (["k1", "k2", "k3"], - ("SELECT t.Symbol, t.GeneId, t.DataId, " - "t.Chr, t.Mb, t.description, " - "t.Probe_Target_Description FROM (SELECT Symbol, " - "max(Mean) AS maxmean " - "FROM TissueProbeSetXRef WHERE " - "TissueProbeSetFreezeId=1 AND " - "Symbol IN (%s, %s, %s) " - "GROUP BY Symbol) AS x INNER JOIN " - "TissueProbeSetXRef AS " - "t ON t.Symbol = x.Symbol " - "AND t.Mean = x.maxmean", - ("k1", "k2", "k3")), - (("k1", "203", - "112", "xy", "20.11", - "Sample Description", - "Sample Probe Target Description"),)), - ), -) -def test_mrna_assay_tissue_data_initialisation(mocker, gene_symbols, - expected_query, - sql_fetch_all_results): - mock_conn = mocker.MagicMock() - with mock_conn.cursor() as cursor: - 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"], - } - cursor.execute.assert_called_with( - "SELECT TissueProbeSetXRef.Symbol, " - "TissueProbeSetData.value FROM " - "TissueProbeSetXRef, TissueProbeSetData " - "WHERE TissueProbeSetData.Id IN (%s) " - "AND TissueProbeSetXRef.DataId = " - "TissueProbeSetData.Id", - ('112',)) -- cgit v1.2.3