Skip to content

Commit

Permalink
Add test_extract_recombination_sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjcroucher committed Jun 3, 2024
1 parent 86f189a commit 7a1218a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/gubbins/tests/test_python_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import unittest
import os
import shutil
import subprocess
import hashlib
import glob
Expand Down Expand Up @@ -144,6 +145,17 @@ def test_recombination_counting_per_gene(self):
assert self.md5_check(out_tab, check_tab)
os.remove(out_tab)

# Test clade file extraction script
def test_extract_recombination_sequences(self):
multiple_aln = os.path.join(data_dir, "multiple_recombinations.aln")
multiple_gff = os.path.join(data_dir, "multiple_recombinations_gubbins.recombination_predictions.gff")
out_dir = os.path.join(data_dir, "test_loci")
rec_count_cmd = "extract_recombinant_sequences.py --aln " + multiple_aln + " --gff " + multiple_gff + " --out-dir " + out_dir
subprocess.check_call(rec_count_cmd, shell=True)
file_count = int(subprocess.run('ls -1 ' + out_dir + ' | wc -l', shell = True, stdout=subprocess.PIPE).stdout.decode('utf-8').rstrip())
assert file_count > 1
shutil.rmtree(out_dir)

# Test plotting script (an R exception)
def test_recombination_counting_per_gene(self):
tree_input = os.path.join(data_dir, "expected_RAxML_result.multiple_recombinations.iteration_5")
Expand Down

0 comments on commit 7a1218a

Please sign in to comment.