diff --git a/pyproject.toml b/pyproject.toml index 93660f5..968422f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "arctic3d" license = "Apache-2.0" -version = "0.1.0" +version = "0.4.1" description = "" authors = [ "Computational Structural Biology Group at Utrecht University ", diff --git a/src/arctic3d/cli.py b/src/arctic3d/cli.py index 6cb4bed..3a7b3d9 100644 --- a/src/arctic3d/cli.py +++ b/src/arctic3d/cli.py @@ -318,9 +318,11 @@ def main( ) # check if there's at least one interface - if Path(run_dir_path, "clustered_interfaces.out").is_file() is False: + if Path("clustered_interfaces.out").is_file() is False: return 255 + return 0 + if __name__ == "__main__": sys.exit(maincli()) diff --git a/tests/test_cli.py b/tests/test_cli.py index 76df37a..1deb528 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -35,3 +35,40 @@ def test_cli_empty(): # remove folder if exp_dir.exists(): shutil.rmtree(exp_dir) + + +def test_cli_full(): + target_uniprot = "W5JXD7" + start_cwd = os.getcwd() + exit_code = main( + input_arg=target_uniprot, + db=None, + interface_file=None, + out_partner=None, + out_pdb=None, + pdb_to_use="3wqb", + chain_to_use=None, + run_dir=None, + interface_data=None, + pdb_data=None, + full=None, + ligand="no", + linkage_strategy=None, + threshold=None, + min_clust_size=1, + ) + assert exit_code == 0 + os.chdir(start_cwd) + exp_dir = Path(f"arctic3d-{target_uniprot}") + assert exp_dir.exists() is True + # Check that the log file has been created + assert Path(exp_dir, "arctic3d.log").exists() + # check content of the clustered interfaces file + assert Path(exp_dir, "clustered_interfaces.out").exists() + # check content of the clustered interfaces file + obs_content = Path(exp_dir, "clustered_interfaces.out").read_text() + exp_content = f"Cluster 1 -> Q9L5A4-3wqb-A{os.linesep}" + assert exp_content == obs_content + # remove folder + if exp_dir.exists(): + shutil.rmtree(exp_dir)