diff options
| author | Alexander_Kabui | 2025-01-23 15:56:58 +0300 |
|---|---|---|
| committer | BonfaceKilz | 2025-02-06 12:43:15 +0300 |
| commit | 6ac8307f7cb8e0d99b694b35ea3669f24715a0f2 (patch) | |
| tree | a87db3de411cd4ad4abd0f3c4b71ecea686b0a5c /tests/unit | |
| parent | 5ccdccc2243e781565d996e157e9d6405a70697b (diff) | |
| download | genenetwork3-6ac8307f7cb8e0d99b694b35ea3669f24715a0f2.tar.gz | |
Add test assertions for writing data to csv.
Diffstat (limited to 'tests/unit')
| -rw-r--r-- | tests/unit/test_rqtl2.py | 17 |
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(): |
