about summary refs log tree commit diff
path: root/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test_rqtl2.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/unit/test_rqtl2.py b/tests/unit/test_rqtl2.py
index 5e4f657..f7830db 100644
--- a/tests/unit/test_rqtl2.py
+++ b/tests/unit/test_rqtl2.py
@@ -18,8 +18,8 @@ def test_generate_rqtl2_files(mock_write_to_csv):
         "/tmp/workspace/pheno_file.csv"
     )
     data = {"crosstype": "riself",
-            "geno_data": [],
-            "pheno_data":  [],
+            "geno_data": [{"NAME": "Ge_code_1"}],
+            "pheno_data":  [{"NAME": "14343_at"}],
             "alleles": ["L", "C"],
             "geno_codes": {
                 "L": 1,
@@ -35,6 +35,19 @@ def test_generate_rqtl2_files(mock_write_to_csv):
                         }
     assert test_results == expected_results
 
+    # assert data is written to the csv
+    expected_calls = [mock.call(
+        "/tmp/workspace",
+        "geno_file.csv",
+        [{"NAME": "Ge_code_1"}]
+    ),
+        mock.call(
+        "/tmp/workspace",
+        "pheno_file.csv",
+        [{"NAME": "14343_at"}]
+    )]
+    mock_write_to_csv.assert_has_calls(expected_calls)
+
 
 @pytest.mark.unit_test
 def test_validate_required_keys():