Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean tools tests #104

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion tests/test_preprocess_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,37 @@ def cleaning_fxns(get_registry):
return CleaningTools(get_registry)


def test_standard_cleaning(path_to_cif, cleaning_fxns):
result = cleaning_fxns._standard_cleaning(path_to_cif)
path_to_cleaned_file = "tidy_" + path_to_cif
os.remove(path_to_cleaned_file)
msg = f"Cleaned File. Standard cleaning. Written to {path_to_cleaned_file}"
assert msg == result


def test_remove_water(path_to_cif, cleaning_fxns):
result = cleaning_fxns._remove_water(path_to_cif)
path_to_cleaned_file = "tidy_" + path_to_cif
os.remove(path_to_cleaned_file)
msg = f"Cleaned File. Removed water. Written to {path_to_cleaned_file}"
assert msg == result


def test_add_hydrogens_and_remove_water(path_to_cif, cleaning_fxns):
result = cleaning_fxns._add_hydrogens_and_remove_water(path_to_cif)
path_to_cleaned_file = "tidy_" + path_to_cif
os.remove(path_to_cleaned_file)
assert "Cleaned File" in result
msg = (
f"Cleaned File. Missing Hydrogens "
f"added and water removed. Written to "
f"{path_to_cleaned_file}"
)
assert msg == result


def test_add_hyrogens(path_to_cif, cleaning_fxns):
result = cleaning_fxns._add_hydrogens(path_to_cif)
path_to_cleaned_file = "tidy_" + path_to_cif
os.remove(path_to_cleaned_file)
msg = f"Cleaned File. Missing Hydrogens added. Written to {path_to_cleaned_file}"
assert msg == result
Loading