Skip to content

Commit

Permalink
changed test_receptor_processor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangplpl committed Apr 8, 2024
1 parent 4891458 commit b729f9e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions unidock_tools/tests/ut/proprep/test_receptor_processor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from pathlib import Path
import os
import pytest
import tempfile



@pytest.fixture
Expand All @@ -9,12 +11,11 @@ def pdb_file():

def test_receptor_preprocessor(pdb_file):
from unidock_tools.modules.protein_prep import receptor_preprocessor
working_dir = '/personal/test_dir'
protein_pdbqt_file_name = receptor_preprocessor(pdb_file, prepared_hydrogen=True, working_dir_name=working_dir)
# Assert that the generated PDBQT file exists
assert os.path.exists(protein_pdbqt_file_name)
# Clean up the generated PDBQT file
#os.remove(protein_pdbqt_file_name)

# Create a temporary working directory
with tempfile.TemporaryDirectory() as temp_dir:
protein_pdbqt_file_name = receptor_preprocessor(pdb_file, prepared_hydrogen=True, working_dir_name=temp_dir)
# Assert that the generated PDBQT file exists
assert os.path.exists(protein_pdbqt_file_name)

if __name__ == "__main__":
pytest.main([__file__])

0 comments on commit b729f9e

Please sign in to comment.