-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename so pytest finds files; remove duplicate test file * Remove classes/setup/teardown, use pytest.fixture; all tests discoverable by pytest * Bug fix where alt probes could be in wrong order
- Loading branch information
1 parent
c1745f0
commit e51db6a
Showing
31 changed files
with
2,499 additions
and
2,811 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import copy | ||
import pytest | ||
|
||
from mykrobe import amr | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import json | ||
import os | ||
import pytest | ||
import subprocess | ||
|
||
from mykrobe.parser import parser | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,37 @@ | ||
from unittest import TestCase | ||
from mykrobe.metagenomics import AMRSpeciesPredictor | ||
|
||
|
||
class MTBCSpeciesTests(TestCase): | ||
|
||
def setUp(self): | ||
pass | ||
|
||
def teardown(self): | ||
pass | ||
|
||
def test_mixed_chimera(self): | ||
species_predictor = AMRSpeciesPredictor( | ||
phylo_group_covgs={}, | ||
sub_complex_covgs={}, | ||
species_covgs={}, | ||
lineage_covgs={} | ||
) | ||
species_predictor.out_json["phylogenetics"] = { | ||
"sub_complex": { | ||
"Mycobacterium_avium_complex": { | ||
"percent_coverage": 98.346, | ||
"median_depth": 54.0 | ||
} | ||
}, | ||
"phylo_group": { | ||
"Non_tuberculosis_mycobacterium_complex": { | ||
"percent_coverage": 82.846, | ||
"median_depth": 49 | ||
} | ||
}, | ||
"species": { | ||
"Mycobacterium_chimaera": { | ||
"percent_coverage": 99.162, | ||
"median_depth": 39 | ||
}, | ||
"Mycobacterium_intracellulare": { | ||
"percent_coverage": 98.662, | ||
"median_depth": 45 | ||
}, | ||
"Mycobacterium_bovis": { | ||
"percent_coverage": 9.894, | ||
"median_depth": 12.0 | ||
} | ||
def test_mixed_chimera(): | ||
species_predictor = AMRSpeciesPredictor( | ||
phylo_group_covgs={}, sub_complex_covgs={}, species_covgs={}, lineage_covgs={} | ||
) | ||
species_predictor.out_json["phylogenetics"] = { | ||
"sub_complex": { | ||
"Mycobacterium_avium_complex": { | ||
"percent_coverage": 98.346, | ||
"median_depth": 54.0, | ||
} | ||
}, | ||
"phylo_group": { | ||
"Non_tuberculosis_mycobacterium_complex": { | ||
"percent_coverage": 82.846, | ||
"median_depth": 49, | ||
} | ||
} | ||
}, | ||
"species": { | ||
"Mycobacterium_chimaera": {"percent_coverage": 99.162, "median_depth": 39}, | ||
"Mycobacterium_intracellulare": { | ||
"percent_coverage": 98.662, | ||
"median_depth": 45, | ||
}, | ||
"Mycobacterium_bovis": {"percent_coverage": 9.894, "median_depth": 12.0}, | ||
}, | ||
} | ||
|
||
out_dict = species_predictor.choose_best( | ||
species_predictor.out_json["phylogenetics"]) | ||
out_dict = species_predictor.choose_best( | ||
species_predictor.out_json["phylogenetics"] | ||
) | ||
|
||
assert "Mycobacterium_chimaera" in out_dict["species"] | ||
assert "Mycobacterium_intracellulare" in out_dict["species"] | ||
assert "Mycobacterium_bovis" not in out_dict["species"] | ||
assert "Mycobacterium_chimaera" in out_dict["species"] | ||
assert "Mycobacterium_intracellulare" in out_dict["species"] | ||
assert "Mycobacterium_bovis" not in out_dict["species"] |
Oops, something went wrong.