From 4142f70801fb1625eb95900b847d17b28132ac66 Mon Sep 17 00:00:00 2001 From: mjohnpayne Date: Thu, 11 Apr 2024 10:00:55 +1000 Subject: [PATCH] add additional tests --- dodge/tests/test_dodge.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dodge/tests/test_dodge.py b/dodge/tests/test_dodge.py index 084ecb0..ca0aec4 100644 --- a/dodge/tests/test_dodge.py +++ b/dodge/tests/test_dodge.py @@ -36,7 +36,7 @@ def compare_files(file1_path, file2_path): class TestMetadatacols(unittest.TestCase): def test_correct_metacols(self): cwd = os.getcwd() - infile = open(cwd+"/tests/inputs/correct_mgt_metadata.txt", "r") + infile = open(cwd+"/dodge/tests/inputs/correct_mgt_metadata.txt", "r") inf = infile.read().splitlines()[0] infile.close() header = inf.split("\t") @@ -46,7 +46,7 @@ def test_correct_metacols(self): def test_noisolate_metacols(self): cwd = os.getcwd() - infile = open(cwd + "/tests/inputs/noisolate_mgt_metadata.txt", "r") + infile = open(cwd + "/dodge/tests/inputs/noisolate_mgt_metadata.txt", "r") inf = infile.read().splitlines()[0] infile.close() header = inf.split("\t") @@ -54,7 +54,7 @@ def test_noisolate_metacols(self): def test_empty_noisolate_metacols(self): cwd = os.getcwd() - infile = open(cwd + "/tests/inputs/empty_mgt_metadata.txt", "r") + infile = open(cwd + "/dodge/tests/inputs/empty_mgt_metadata.txt", "r") inf = infile.read().splitlines()[0] infile.close() header = inf.split("\t") @@ -128,13 +128,13 @@ def test_with_dummy_week_investigation(self): self.maxDiff = 5000 cwd = os.getcwd() - args = argparse.Namespace(variant_data = cwd+"/tests/inputs/fulltest1_2_allele_ap.txt", + args = argparse.Namespace(variant_data = cwd+"/dodge/tests/inputs/fulltest1_2_allele_ap.txt", inputtype = "allele", - strainmetadata = cwd+"/tests/inputs/fulltest1_week_allele_metadata.txt", + strainmetadata = cwd+"/dodge/tests/inputs/fulltest1_week_allele_metadata.txt", outputPrefix = cwd+"/outputs/fulltest1_out", - distances = cwd+"/tests/inputs/fulltest1_background_pairwise_distances.txt", + distances = cwd+"/dodge/tests/inputs/fulltest1_background_pairwise_distances.txt", # distances = "apg_testing/input_data/stm/vic_only_5min_2018bg_2021-01-26_2021-02-01_pairwise_distances.txt", - inclusters = cwd+"/tests/inputs/fulltest1_background_all_clusters.txt", + inclusters = cwd+"/dodge/tests/inputs/fulltest1_background_all_clusters.txt", # inclusters = False, # inclusters = "/Users/mjohnpayne/Library/CloudStorage/OneDrive-UNSW/Salmonella/2_stage_clustering/manuscript/bioinformatics_submission/revision/Aus2months/v7_static_background_all_clusters.txt", # inclusters = "/Users/mjohnpayne/Library/CloudStorage/OneDrive-UNSW/Salmonella/2_stage_clustering/manuscript/bioinformatics_submission/revision/Aus2months/v4_background_all_clusters.txt", @@ -171,13 +171,13 @@ def test_with_dummy_week_investigation(self): def test_with_dummy_month_investigation(self): self.maxDiff = 5000 cwd = os.getcwd() - args = argparse.Namespace(variant_data = cwd+"/tests/inputs/fulltest1_2_allele_ap.txt", + args = argparse.Namespace(variant_data = cwd+"/dodge/tests/inputs/fulltest1_2_allele_ap.txt", inputtype = "allele", - strainmetadata = cwd+"/tests/inputs/fulltest2_month_allele_metadata.txt", + strainmetadata = cwd+"/dodge/tests/inputs/fulltest2_month_allele_metadata.txt", outputPrefix = cwd+"/outputs/fulltest2_out", - distances = cwd+"/tests/inputs/fulltest2_background_pairwise_distances.txt", + distances = cwd+"/dodge/tests/inputs/fulltest2_background_pairwise_distances.txt", # distances = "apg_testing/input_data/stm/vic_only_5min_2018bg_2021-01-26_2021-02-01_pairwise_distances.txt", - inclusters = cwd+"/tests/inputs/fulltest2_background_all_clusters.txt", + inclusters = cwd+"/dodge/tests/inputs/fulltest2_background_all_clusters.txt", # inclusters = False, # inclusters = "/Users/mjohnpayne/Library/CloudStorage/OneDrive-UNSW/Salmonella/2_stage_clustering/manuscript/bioinformatics_submission/revision/Aus2months/v7_static_background_all_clusters.txt", # inclusters = "/Users/mjohnpayne/Library/CloudStorage/OneDrive-UNSW/Salmonella/2_stage_clustering/manuscript/bioinformatics_submission/revision/Aus2months/v4_background_all_clusters.txt",