aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorBonfaceKilz2020-12-06 15:29:10 +0300
committerGitHub2020-12-06 15:29:10 +0300
commit72215ca9ab694be3790c8b47869463cb6e1376ee (patch)
tree9da7fefdfacad1531d6bda926fc58aec82d69a06 /wqflask
parentb39395e648d8f1f26e3455c3be8dd1a2ec0d3592 (diff)
parent54fc88f3f0f4966608fccdba76b49871eef50553 (diff)
downloadgenenetwork2-72215ca9ab694be3790c8b47869463cb6e1376ee.tar.gz
Merge pull request #503 from Alexanderlacuna/bugfix/gemma-mapping-tests
update tests for run_gemma
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py b/wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py
index 5b621264..b8c13ab4 100644
--- a/wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py
+++ b/wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py
@@ -43,22 +43,22 @@ class TestGemmaMapping(unittest.TestCase):
@mock.patch("wqflask.marker_regression.gemma_mapping.GEMMA_WRAPPER_COMMAND", "ghc")
@mock.patch("wqflask.marker_regression.gemma_mapping.TEMPDIR", "/home/user/data/")
@mock.patch("wqflask.marker_regression.gemma_mapping.parse_loco_output")
- @mock.patch("wqflask.marker_regression.gemma_mapping.logger")
@mock.patch("wqflask.marker_regression.gemma_mapping.flat_files")
@mock.patch("wqflask.marker_regression.gemma_mapping.gen_covariates_file")
@mock.patch("wqflask.marker_regression.run_mapping.random.choice")
@mock.patch("wqflask.marker_regression.gemma_mapping.os")
@mock.patch("wqflask.marker_regression.gemma_mapping.gen_pheno_txt_file")
- def test_run_gemma_firstrun_set_true(self, mock_gen_pheno_txt, mock_os, mock_choice, mock_gen_covar, mock_flat_files, mock_logger, mock_parse_loco):
+ def test_run_gemma_firstrun_set_true(self, mock_gen_pheno_txt, mock_os, mock_choice, mock_gen_covar, mock_flat_files,mock_parse_loco):
"""add tests for run_gemma where first run is set to true"""
- chromosomes = []
+ this_chromosomes={}
for i in range(1, 5):
- chromosomes.append(AttributeSetter({"name": f"CH{i}"}))
- chromo = AttributeSetter({"chromosomes": chromosomes})
+ this_chromosomes[f'CH{i}']=(AttributeSetter({"name": f"CH{i}"}))
+ chromosomes = AttributeSetter({"chromosomes": this_chromosomes})
+
dataset_group = MockGroup(
{"name": "GP1", "genofile": "file_geno"})
dataset = AttributeSetter({"group": dataset_group, "name": "dataset1_name",
- "species": AttributeSetter({"chromosomes": chromo})})
+ "species": AttributeSetter({"chromosomes": chromosomes})})
trait = AttributeSetter({"name": "trait1"})
samples = []
mock_gen_pheno_txt.return_value = None
@@ -76,7 +76,6 @@ class TestGemmaMapping(unittest.TestCase):
mock_parse_loco.assert_called_once_with(dataset, "GP1_GWA_RRRRRR")
mock_os.path.isfile.assert_called_once_with(
('/home/user/imgfile_output.assoc.txt'))
- self.assertEqual(mock_logger.debug.call_count, 2)
self.assertEqual(mock_flat_files.call_count, 4)
self.assertEqual(results, ([], "GP1_GWA_RRRRRR"))