diff options
author | zsloan | 2021-06-18 22:16:26 +0000 |
---|---|---|
committer | zsloan | 2021-06-18 22:16:26 +0000 |
commit | d8c4b1a0188574cdd70638a99e2984b54bec6033 (patch) | |
tree | d9df734549f46d698a0ea8d7901c46e10d78d22e /tests/unit | |
parent | efe73f2f142bd2a12b89ad638c9387cf9c6ded18 (diff) | |
download | genenetwork3-d8c4b1a0188574cdd70638a99e2984b54bec6033.tar.gz |
Fixed test_rqtl.py to include Rscript in the command
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/computations/test_rqtl.py | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/tests/unit/computations/test_rqtl.py b/tests/unit/computations/test_rqtl.py index b16f136..3bf8f81 100644 --- a/tests/unit/computations/test_rqtl.py +++ b/tests/unit/computations/test_rqtl.py @@ -1,41 +1,41 @@ -"""Test cases for procedures defined in computations.rqtl"""
-import unittest
-
-from unittest import mock
-from gn3.computations.rqtl import generate_rqtl_cmd
-
-class TestRqtl(unittest.TestCase):
- """Test cases for computations.rqtl module"""
- @mock.patch("gn3.computations.rqtl.generate_hash_of_string")
- @mock.patch("gn3.computations.rqtl.get_hash_of_files")
- def test_generate_rqtl_command(self, mock_get_hash_files, mock_generate_hash_string):
- """Test computing mapping results with R/qtl"""
- mock_get_hash_files.return_value = "my-hash1"
- mock_generate_hash_string.return_value = "my-hash2"
-
- self.assertEqual(
- generate_rqtl_cmd(rqtl_wrapper_cmd="rqtl-wrapper",
- rqtl_wrapper_kwargs={
- "g": "genofile",
- "p": "phenofile",
- "model": "normal",
- "method": "hk",
- "nperm": 1000,
- "scale": "Mb",
- "control": "rs123456"
- },
- rqtl_wrapper_bool_kwargs=[
- "addcovar",
- "interval"
- ]), {
- "output_file":
- "my-hash1my-hash2my-hash2-output.json",
- "rqtl_cmd": (
- "rqtl-wrapper "
- "--g genofile --p phenofile "
- "--model normal --method hk "
- "--nperm 1000 --scale Mb "
- "--control rs123456 "
- "--addcovar --interval"
- )
- })
+"""Test cases for procedures defined in computations.rqtl""" +import unittest + +from unittest import mock +from gn3.computations.rqtl import generate_rqtl_cmd + +class TestRqtl(unittest.TestCase): + """Test cases for computations.rqtl module""" + @mock.patch("gn3.computations.rqtl.generate_hash_of_string") + @mock.patch("gn3.computations.rqtl.get_hash_of_files") + def test_generate_rqtl_command(self, mock_get_hash_files, mock_generate_hash_string): + """Test computing mapping results with R/qtl""" + mock_get_hash_files.return_value = "my-hash1" + mock_generate_hash_string.return_value = "my-hash2" + + self.assertEqual( + generate_rqtl_cmd(rqtl_wrapper_cmd="rqtl-wrapper", + rqtl_wrapper_kwargs={ + "g": "genofile", + "p": "phenofile", + "model": "normal", + "method": "hk", + "nperm": 1000, + "scale": "Mb", + "control": "rs123456" + }, + rqtl_wrapper_bool_kwargs=[ + "addcovar", + "interval" + ]), { + "output_file": + "my-hash1my-hash2my-hash2-output.json", + "rqtl_cmd": ( + "Rscript rqtl-wrapper " + "--g genofile --p phenofile " + "--model normal --method hk " + "--nperm 1000 --scale Mb " + "--control rs123456 " + "--addcovar --interval" + ) + }) |