Skip to content

Commit

Permalink
cleaning tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCox822 committed Mar 6, 2024
1 parent 91f8ddb commit 2529886
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions tests/test_preprocess_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +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_standard_cleaning(path_to_cif, cleaning_fxns):
result = cleaning_fxns._standard_cleaning(path_to_cif)
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)
assert "Cleaned File" in result
msg = f"Cleaned File. Missing Hydrogens added. Written to {path_to_cleaned_file}"
assert msg == result

0 comments on commit 2529886

Please sign in to comment.