diff options
author | BonfaceKilz | 2021-03-04 22:20:55 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-03-08 21:09:58 +0300 |
commit | db1eaaf359749814859b969d1fb4fb3341004705 (patch) | |
tree | ccef744cfdff067b4e2980cbaea6d487bf4c40f5 | |
parent | 47684b060649695f32a7fe465f018b8ffb53cf37 (diff) | |
download | genenetwork3-db1eaaf359749814859b969d1fb4fb3341004705.tar.gz |
bug: Put a space between gemma-wrapper args
-rw-r--r-- | gn3/commands.py | 6 | ||||
-rw-r--r-- | tests/unit/test_commands.py | 17 |
2 files changed, 20 insertions, 3 deletions
diff --git a/gn3/commands.py b/gn3/commands.py index 7a4eb48..7287348 100644 --- a/gn3/commands.py +++ b/gn3/commands.py @@ -20,9 +20,9 @@ def compose_gemma_cmd( """Compose a valid GEMMA command given the correct values""" cmd = f"{gemma_wrapper_cmd} --json" if gemma_wrapper_kwargs: - cmd += (" " # Add extra space between commands - " ".join([f"--{key} {val}" for key, val - in gemma_wrapper_kwargs.items()])) + cmd += " " # Add extra space between commands + cmd += " ".join([f"--{key} {val}" for key, val + in gemma_wrapper_kwargs.items()]) cmd += " -- " if gemma_kwargs: cmd += " ".join([f"-{key} {val}" diff --git a/tests/unit/test_commands.py b/tests/unit/test_commands.py index 846d20c..c51118d 100644 --- a/tests/unit/test_commands.py +++ b/tests/unit/test_commands.py @@ -36,6 +36,23 @@ class TestCommands(unittest.TestCase): "-p /tmp/gf13Ad0tRX/phenofile.txt" " -gk")) + def test_compose_gemma_cmd_extra_args(self): + """Test that the gemma cmd is composed correctly""" + self.assertEqual( + compose_gemma_cmd(gemma_wrapper_cmd="gemma-wrapper", + gemma_wrapper_kwargs={ + "loco": "1,2,3,4" + }, + gemma_kwargs={ + "g": "/tmp/genofile.txt", + "p": "/tmp/gf13Ad0tRX/phenofile.txt" + }, + gemma_args=["-gk"]), + ("gemma-wrapper --json --loco 1,2,3,4 -- " + "-g /tmp/genofile.txt " + "-p /tmp/gf13Ad0tRX/phenofile.txt" + " -gk")) + 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, |