Skip to content

Commit

Permalink
Merge pull request #11 from eastgenomics/DI-809_refactor
Browse files Browse the repository at this point in the history
DI-809 - fix tests from output filename change (#11)
  • Loading branch information
Yu-jinKim authored Sep 23, 2024
2 parents 8c02f2a + 0078be5 commit b648649
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_vcf_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,17 +345,17 @@ def test_output_file_contents_correctly_written(self):
"x_het_hom_ratio": None,
}

vcf_qc.write_output_file(outfile="test.vcf.qc", ratios=ratios)
vcf_qc.write_output_file(outfile="test.vcf.QC", ratios=ratios)

with open("test.vcf.qc", "r") as fh:
with open("test.vcf.QC", "r") as fh:
written_contents = fh.readlines()

expected_contents = [
"mean_het\tmean_hom\thet_hom_ratio\tx_het_hom_ratio\n",
"0.5000\t0.9900\t0.6000\tNone\n",
]

os.remove("test.vcf.qc")
os.remove("test.vcf.QC")

self.assertEqual(written_contents, expected_contents)

Expand All @@ -368,10 +368,10 @@ def test_upload_params_correct(self, mock_job, mock_upload):
"folder": "/output/sub_folder"
}

vcf_qc.upload_output_file("test.vcf.qc")
vcf_qc.upload_output_file("test.vcf.QC")

expected_args = {
"filename": "test.vcf.qc",
"filename": "test.vcf.QC",
"folder": "/output/sub_folder",
"wait_on_close": True,
}
Expand All @@ -382,7 +382,7 @@ def test_expected_dxlink_format_returned(self, mock_job, mock_upload):
mock_upload.return_value = "file-xxx"

self.assertEqual(
vcf_qc.upload_output_file("test.vcf.qc"),
vcf_qc.upload_output_file("test.vcf.QC"),
{"output_file": {"$dnanexus_link": "file-xxx"}},
)

Expand Down Expand Up @@ -495,7 +495,7 @@ def test_running_in_dnanexus_calls_download_upload_functions(
self.mock_write_output_file.assert_called_once()

with self.subTest("outfile name correct"):
output_file = f"{self.test_vcf}.qc"
output_file = f"{self.test_vcf}.QC"

assert (
output_file
Expand Down

0 comments on commit b648649

Please sign in to comment.