Skip to content

Commit

Permalink
Simplify check for genes in test
Browse files Browse the repository at this point in the history
  • Loading branch information
samuell committed Aug 13, 2024
1 parent a9a30ca commit 8bf9540
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/test_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,13 @@ def test_blast_scraping(scraper, testdata_prefix, caplog):
caplog.set_level(logging.DEBUG)
scraper.scrape_blast(type='seq_type',file_list=["{}/blast_single_loci.txt".format(testdata_prefix)])
assert "candidate" in caplog.text

caplog.clear()
hits = scraper.scrape_blast(type='resistance',file_list=["{}/blast_single_resistance.txt".format(testdata_prefix)])
genes = [h["gene"] for h in hits]
assert "blaOXA-48" in genes

has_vim4 = False
for gene in genes:
if gene == "blaVIM-4":
has_vim4 = True
assert has_vim4
assert "blaOXA-48" in genes
assert "blaVIM-4" in genes

def test_alignment_scraping(scraper, init_references, testdata_prefix):
scraper.scrape_alignment(file_list=glob.glob("{}/*.stats.*".format(testdata_prefix)))

0 comments on commit 8bf9540

Please sign in to comment.