about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzsloan2021-05-18 20:06:57 +0000
committerzsloan2021-05-18 20:06:57 +0000
commitd66b71a1e149ccddbbcc66e439067250827e0b6f (patch)
tree7c68a2cfc9653a429dc436be89ae50d8e6ac73e3
parent36365588d95d96458da02090ebef21a02366784a (diff)
downloadgenenetwork3-d66b71a1e149ccddbbcc66e439067250827e0b6f.tar.gz
Added test for compose_rqtl_cmd in tests/unit/test_commands.py
-rw-r--r--tests/unit/test_commands.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/unit/test_commands.py b/tests/unit/test_commands.py
index aafb3a2..a3d0273 100644
--- a/tests/unit/test_commands.py
+++ b/tests/unit/test_commands.py
@@ -6,6 +6,7 @@ from datetime import datetime
 from typing import Callable
 from unittest import mock
 from gn3.commands import compose_gemma_cmd
+from gn3.commands import compose_rqtl_cmd
 from gn3.commands import queue_cmd
 from gn3.commands import run_cmd
 from gn3.exceptions import RedisConnectionError
@@ -53,6 +54,31 @@ class TestCommands(unittest.TestCase):
              "-p /tmp/gf13Ad0tRX/phenofile.txt"
              " -gk"))
 
+    def test_compose_rqtl_cmd(self):
+        """Test that the R/qtl cmd is composed correctly"""
+        self.assertEqual(
+            compose_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"
+                             ]),
+            ("rqtl-wrapper "
+             "--g genofile --p phenofile "
+             "--model normal --method hk "
+             "--nperm 1000 --scale Mb "
+             "--control rs123456 "
+             "--addcovar --interval")
+        )
+
     def test_queue_cmd_exception_raised_when_redis_is_down(self):
         """Test that the correct error is raised when Redis is unavailable"""
         self.assertRaises(RedisConnectionError,