Skip to content

Commit 2529886

Browse files
committed
cleaning tests added
1 parent 91f8ddb commit 2529886

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

tests/test_preprocess_tools.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,37 @@ def cleaning_fxns(get_registry):
3333
return CleaningTools(get_registry)
3434

3535

36+
def test_standard_cleaning(path_to_cif, cleaning_fxns):
37+
result = cleaning_fxns._standard_cleaning(path_to_cif)
38+
path_to_cleaned_file = "tidy_" + path_to_cif
39+
os.remove(path_to_cleaned_file)
40+
msg = f"Cleaned File. Standard cleaning. Written to {path_to_cleaned_file}"
41+
assert msg == result
42+
43+
44+
def test_remove_water(path_to_cif, cleaning_fxns):
45+
result = cleaning_fxns._remove_water(path_to_cif)
46+
path_to_cleaned_file = "tidy_" + path_to_cif
47+
os.remove(path_to_cleaned_file)
48+
msg = f"Cleaned File. Removed water. Written to {path_to_cleaned_file}"
49+
assert msg == result
50+
51+
3652
def test_add_hydrogens_and_remove_water(path_to_cif, cleaning_fxns):
3753
result = cleaning_fxns._add_hydrogens_and_remove_water(path_to_cif)
3854
path_to_cleaned_file = "tidy_" + path_to_cif
3955
os.remove(path_to_cleaned_file)
40-
assert "Cleaned File" in result
56+
msg = (
57+
f"Cleaned File. Missing Hydrogens "
58+
f"added and water removed. Written to "
59+
f"{path_to_cleaned_file}"
60+
)
61+
assert msg == result
4162

4263

43-
def test_standard_cleaning(path_to_cif, cleaning_fxns):
44-
result = cleaning_fxns._standard_cleaning(path_to_cif)
64+
def test_add_hyrogens(path_to_cif, cleaning_fxns):
65+
result = cleaning_fxns._add_hydrogens(path_to_cif)
4566
path_to_cleaned_file = "tidy_" + path_to_cif
4667
os.remove(path_to_cleaned_file)
47-
assert "Cleaned File" in result
68+
msg = f"Cleaned File. Missing Hydrogens added. Written to {path_to_cleaned_file}"
69+
assert msg == result

0 commit comments

Comments
 (0)