aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_commands.py
diff options
context:
space:
mode:
authorAlexander Kabui2021-06-20 09:11:03 +0300
committerAlexander Kabui2021-06-20 09:11:03 +0300
commit123ad47af288d6b94f0354a0abd5bc669bc988d4 (patch)
tree999eb41c1fab3d443215c0e4a8533abecf64f9af /tests/unit/test_commands.py
parent75801d83c8302b48051d413490e6ce2a0b8ff01f (diff)
parentd653a635d0efd2291754c18f51d31f91a1c0a25c (diff)
downloadgenenetwork3-123ad47af288d6b94f0354a0abd5bc669bc988d4.tar.gz
merge main
Diffstat (limited to 'tests/unit/test_commands.py')
-rw-r--r--tests/unit/test_commands.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/test_commands.py b/tests/unit/test_commands.py
index aafb3a2..f36ba55 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,30 @@ 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": "the_genofile",
+ "p": "the_phenofile",
+ "model": "np",
+ "method": "ehk",
+ "nperm": 2000,
+ "scale": "Mb",
+ "control": "rs234567"
+ },
+ rqtl_wrapper_bool_kwargs=[
+ "addcovar"
+ ]),
+ ("Rscript rqtl-wrapper "
+ "--g the_genofile --p the_phenofile "
+ "--model np --method ehk "
+ "--nperm 2000 --scale Mb "
+ "--control rs234567 "
+ "--addcovar")
+ )
+
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,