Skip to content

Commit

Permalink
Implement basic tests of cli
Browse files Browse the repository at this point in the history
  • Loading branch information
andersgs committed Sep 5, 2019
1 parent cfe0b87 commit 4a02927
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/test_run_emmtyper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""
Test the command line intereface
"""

from click.testing import CliRunner
from emmtyper.bin.run_emmtyper import main
from emmtyper import __version__ as version

from tests.data import test_sequence_path


runner = CliRunner()


def test_run_emmtyper_version():
"""
Test emmtyper --version flag
"""
result = runner.invoke(main, ["--version"])
assert result.exit_code == 0
assert result.output == f"emmtyper v{version}\n"


def test_run_emmtyper_basic_blast():
"""
Test basic blast workflow
"""
result = runner.invoke(main, [test_sequence_path])
assert result.exit_code == 0
assert result.output == "contig.tmp\t1\tEMM1.0\t\tA-C3\n"


def test_run_emmtyper_basic_ispcr():
"""
Test basic ispcr workflow
"""
result = runner.invoke(main, ["-w", "pcr", test_sequence_path])
assert result.exit_code == 0
assert result.output == "contig_pcr.tmp\t1\tEMM1.0\t\tA-C3\n"

0 comments on commit 4a02927

Please sign in to comment.