Skip to content

Commit

Permalink
add install to every command in case
Browse files Browse the repository at this point in the history
  • Loading branch information
gbouras13 committed Feb 23, 2024
1 parent 461ec48 commit 1259f23
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def remove_directory(dir_path):
# return tmpdir_factory.mktemp("tmp")


temp_dir = Path(f"{test_data}/fake_out")

# the server can be down
run_remote = False

Expand Down Expand Up @@ -88,55 +86,71 @@ def test_install():
def test_run_genbank():
"""test phold run with genbank input"""
input_gbk: Path = f"{test_data}/combined_truncated_acr_defense_vfdb_card.gbk"
cmd = f"phold install -d {database_dir} "
exec_command(cmd)
cmd = f"phold run -i {input_gbk} -o {run_gbk_dir} -t {threads} --cpu -d {database_dir} -f"
exec_command(cmd)


def test_predict_genbank():
"""test phold predict with genbank input"""
input_gbk: Path = f"{test_data}/combined_truncated_acr_defense_vfdb_card.gbk"
cmd = f"phold install -d {database_dir} "
exec_command(cmd)
cmd = f"phold predict -i {input_gbk} -o {predict_gbk_dir} -t {threads} --cpu -d {database_dir} -f"
exec_command(cmd)


def test_compare_genbank():
"""test phold compare with genbank input"""
input_gbk: Path = f"{test_data}/combined_truncated_acr_defense_vfdb_card.gbk"
cmd = f"phold install -d {database_dir} "
exec_command(cmd)
cmd = f"phold compare -i {input_gbk} -o {compare_gbk_dir} --predictions_dir {predict_gbk_dir} -t {threads} -d {database_dir} -f"
exec_command(cmd)


def test_compare_pdb():
"""test phold compare with pdbs input"""
input_gbk: Path = f"{test_data}/NC_043029.gbk"
cmd = f"phold install -d {database_dir} "
exec_command(cmd)
cmd = f"phold compare -i {input_gbk} -o {compare_pdb_dir} -t {threads} -d {database_dir} --pdb --pdb_dir {pdb_dir} -f"
exec_command(cmd)


def test_predict_fasta():
"""test phold predict with fasta input"""
input_fasta: Path = f"{test_data}/combined_truncated_acr_defense_vfdb_card.gbk"
cmd = f"phold install -d {database_dir} "
exec_command(cmd)
cmd = f"phold predict -i {input_fasta} -o {predict_fasta_dir} -t {threads} -d {database_dir} --cpu -f"
exec_command(cmd)


def test_compare_fasta():
"""test phold compare with fasta input"""
input_fasta: Path = f"{test_data}/combined_truncated_acr_defense_vfdb_card.fasta"
cmd = f"phold install -d {database_dir} "
exec_command(cmd)
cmd = f"phold compare -i {input_fasta} -o {compare_fasta_dir} --predictions_dir {predict_fasta_dir} -t {threads} -d {database_dir} -f"
exec_command(cmd)


def test_proteins_predict():
"""test phold proteins-predict"""
input_fasta: Path = f"{test_data}/phanotate.faa"
cmd = f"phold install -d {database_dir} "
exec_command(cmd)
cmd = f"phold proteins-predict -i {input_fasta} -o {proteins_predict_dir} -t {threads} -d {database_dir} --cpu -f"
exec_command(cmd)


def test_proteins_compare():
"""test phold proteins-compare"""
input_fasta: Path = f"{test_data}/phanotate.faa"
cmd = f"phold install -d {database_dir} "
exec_command(cmd)
cmd = f"phold proteins-compare -i {input_fasta} --predictions_dir {proteins_predict_dir} -o {proteins_compare_dir} -t {threads} -d {database_dir} -f"
exec_command(cmd)

Expand All @@ -146,6 +160,8 @@ def test_proteins_compare():
def test_remote_genbank():
"""test phold remote with genbank input"""
input_gbk: Path = f"{test_data}/combined_truncated_acr_defense_vfdb_card.gbk"
cmd = f"phold install -d {database_dir} "
exec_command(cmd)
cmd = f"phold remote -i {input_gbk} -o {remote_gbk_dir} -t {threads} -d {database_dir} -f"
exec_command(cmd)

Expand All @@ -154,6 +170,8 @@ def test_remote_fasta():
input_fasta: Path = (
f"{test_data}/combined_truncated_acr_defense_vfdb_card.fasta"
)
cmd = f"phold install -d {database_dir} "
exec_command(cmd)
cmd = f"phold remote -i {input_fasta} -o {remote_fasta_dir} -t {threads} -d {database_dir} -f"
exec_command(cmd)

Expand All @@ -170,5 +188,3 @@ def test_remote_fasta():


remove_directory(output_dir)


0 comments on commit 1259f23

Please sign in to comment.