From 7402876bc7f7bbcd80f4162e04e39446b3121807 Mon Sep 17 00:00:00 2001 From: tcezard Date: Wed, 4 Sep 2024 16:21:36 +0100 Subject: [PATCH] Fix tests --- eva_submission/submission_qc_checks.py | 14 +++--- tests/test_submission_qc.py | 64 +++++++++++--------------- 2 files changed, 34 insertions(+), 44 deletions(-) diff --git a/eva_submission/submission_qc_checks.py b/eva_submission/submission_qc_checks.py index 9131431..d22546d 100644 --- a/eva_submission/submission_qc_checks.py +++ b/eva_submission/submission_qc_checks.py @@ -344,14 +344,13 @@ def check_if_accessioning_completed_successfully(self): failed_files[file] = f"Accessioning Error : No accessioning file found for {file}" result = "PASS" if not failed_files else "FAIL" - report = f""" - Success: {result}""" + report = f"""Success: {result}""" if failed_files: report += f""" - failed_files:""" + failed_files:""" for file, value in failed_files.items(): report += f""" - {file} - {value}""" + {file} - {value}""" return result, report @@ -453,14 +452,13 @@ def check_if_variants_were_skipped_while_accessioning(self): failed_files[file] = f"Accessioning Error : No accessioning file found for {file}" result = "PASS" if not failed_files else "PASS with Warning (Manual Check Required)" - report = f""" - Success: {result}""" + report = f"""Success: {result}""" if failed_files: report += f""" - Failures:""" + Failures:""" for file, value in failed_files.items(): report += f""" - {file} - {value}""" + {file} - {value}""" return result, report diff --git a/tests/test_submission_qc.py b/tests/test_submission_qc.py index f9b198b..10fdea0 100644 --- a/tests/test_submission_qc.py +++ b/tests/test_submission_qc.py @@ -154,18 +154,16 @@ def expected_report_of_eload_101(self): Missing files: {'test2.vcf.gz'} --------------------------------- Accessioning job check: - - pass: FAIL - failed_files: - test1.vcf.gz - Accessioning Error : No accessioning file found for test1.vcf.gz - test2.vcf.gz - Accessioning Error : No accessioning file found for test2.vcf.gz + Success: FAIL + failed_files: + test1.vcf.gz - Accessioning Error : No accessioning file found for test1.vcf.gz + test2.vcf.gz - Accessioning Error : No accessioning file found for test2.vcf.gz ---------------------------------- Variants skipped check: - - Success: PASS with Warning (Manual Check Required) - Failures: - test1.vcf.gz - Accessioning Error : No accessioning file found for test1.vcf.gz - test2.vcf.gz - Accessioning Error : No accessioning file found for test2.vcf.gz + Success: PASS with Warning (Manual Check Required) + Failures: + test1.vcf.gz - Accessioning Error : No accessioning file found for test1.vcf.gz + test2.vcf.gz - Accessioning Error : No accessioning file found for test2.vcf.gz ---------------------------------- Variant load check: Success: FAIL @@ -191,8 +189,8 @@ def expected_report_of_eload_101(self): Accession Import check: Success: FAIL Errors: - test1.vcf.gz - load_vcf error : No load_vcf log file found for test1.vcf.gz - test2.vcf.gz - load_vcf error : No load_vcf log file found for test2.vcf.gz + test1.vcf.gz - acc_import error : No acc_import log file found for test1.vcf.gz + test2.vcf.gz - acc_import error : No acc_import log file found for test2.vcf.gz ---------------------------------- Remapping Check: N/A @@ -244,17 +242,15 @@ def expected_report_of_eload_102(self): Missing files: None --------------------------------- Accessioning job check: - - pass: FAIL - failed_files: - test1.vcf.gz - failed job/step : CREATE_SUBSNP_ACCESSION_STEP - test2.vcf.gz - Accessioning Error : No accessioning file found for test2.vcf.gz + Success: FAIL + failed_files: + test1.vcf.gz - failed job/step : CREATE_SUBSNP_ACCESSION_STEP + test2.vcf.gz - Accessioning Error : No accessioning file found for test2.vcf.gz ---------------------------------- Variants skipped check: - - Success: PASS with Warning (Manual Check Required) - Failures: - test2.vcf.gz - Accessioning Error : No accessioning file found for test2.vcf.gz + Success: PASS with Warning (Manual Check Required) + Failures: + test2.vcf.gz - Accessioning Error : No accessioning file found for test2.vcf.gz ---------------------------------- Variant load check: Success: FAIL @@ -280,8 +276,8 @@ def expected_report_of_eload_102(self): Accession Import check: Success: FAIL Errors: - test1.vcf.gz - load_vcf error : No load_vcf log file found for test1.vcf.gz - test2.vcf.gz - load_vcf error : No load_vcf log file found for test2.vcf.gz + test1.vcf.gz - acc_import failed job/step : accession-import-step + test2.vcf.gz - acc_import error : No acc_import log file found for test2.vcf.gz ---------------------------------- Remapping Check: N/A @@ -334,12 +330,10 @@ def expected_report_of_eload_103(self): Missing files: None --------------------------------- Accessioning job check: - - pass: PASS + Success: PASS ---------------------------------- Variants skipped check: - - Success: PASS + Success: PASS ---------------------------------- Variant load check: Success: PASS @@ -414,16 +408,14 @@ def expected_report_of_eload_104(self): Missing files: None --------------------------------- Accessioning job check: - - pass: FAIL - failed_files: - test1.vcf.gz - Accessioning Error : No accessioning file found for test1.vcf.gz + Success: FAIL + failed_files: + test1.vcf.gz - Accessioning Error : No accessioning file found for test1.vcf.gz ---------------------------------- Variants skipped check: - - Success: PASS with Warning (Manual Check Required) - Failures: - test1.vcf.gz - Accessioning Error : No accessioning file found for test1.vcf.gz + Success: PASS with Warning (Manual Check Required) + Failures: + test1.vcf.gz - Accessioning Error : No accessioning file found for test1.vcf.gz ---------------------------------- Variant load check: Success: FAIL @@ -448,7 +440,7 @@ def expected_report_of_eload_104(self): Accession Import check: Success: FAIL Errors: - test1.vcf.gz - load_vcf error : No load_vcf log file found for test1.vcf.gz + test1.vcf.gz - acc_import error : No acc_import log file found for test1.vcf.gz ---------------------------------- Remapping Check: Source assembly GCA_000003205.6: