aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/unit/test_commands.py32
1 files changed, 13 insertions, 19 deletions
diff --git a/tests/unit/test_commands.py b/tests/unit/test_commands.py
index 9dfa9f9..d96706c 100644
--- a/tests/unit/test_commands.py
+++ b/tests/unit/test_commands.py
@@ -1,5 +1,4 @@
"""Test cases for procedures defined in commands.py"""
-import os
import unittest
from dataclasses import dataclass
@@ -23,24 +22,19 @@ class MockRedis:
class TestCommands(unittest.TestCase):
"""Test cases for commands.py"""
- @mock.patch("gn3.commands.lookup_file")
- def test_compose_gemma_cmd_no_extra_args(self, mock_lookup_file):
- """Test that thhe gemma cmd is composed correctly"""
- metadata_file = os.path.join(os.path.dirname(__file__),
- "test_data/metadata.json")
- mock_lookup_file.side_effect = [metadata_file,
- "/tmp/genofile.txt",
- "/tmp/gf13Ad0tRX/phenofile.txt"]
- self.assertEqual(compose_gemma_cmd("gf13Ad0t",
- "metadata.json",
- gemma_wrapper_cmd="gemma-wrapper",
- gemma_wrapper_kwargs=None,
- gemma_kwargs=None,
- gemma_args=["-gk"]),
- ("gemma-wrapper --json -- "
- "-g /tmp/genofile.txt "
- "-p /tmp/gf13Ad0tRX/phenofile.txt"
- " -gk"))
+ def test_compose_gemma_cmd_no_extra_args(self):
+ """Test that the gemma cmd is composed correctly"""
+ self.assertEqual(
+ compose_gemma_cmd(gemma_wrapper_cmd="gemma-wrapper",
+ gemma_kwargs={
+ "g": "/tmp/genofile.txt",
+ "p": "/tmp/gf13Ad0tRX/phenofile.txt"
+ },
+ gemma_args=["-gk"]),
+ ("gemma-wrapper --json -- "
+ "-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"""