Skip to content

Commit f9c81f4

Browse files
committed
Add unit tests
1 parent 7c003f9 commit f9c81f4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

test_extras/test_chemprop/test_neural_fingerprint.py

+5
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ def test_json_serialization(self) -> None:
3333
chemprop_json = recursive_to_json(chemprop_fp_encoder)
3434
chemprop_encoder_copy = recursive_from_json(chemprop_json)
3535
compare_params(self, chemprop_fp_encoder, chemprop_encoder_copy)
36+
37+
def test_output_type(self) -> None:
38+
"""Test the output type."""
39+
chemprop_fp_encoder = get_neural_fp_encoder()
40+
self.assertEqual(chemprop_fp_encoder.output_type, "float")

tests/test_elements/test_mol2any/test_mol2morgan_fingerprint.py

+7
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ def test_counted_bits(self) -> None:
6363
self.assertTrue(np.any(output_counted > output_binary))
6464

6565
def test_output_types(self) -> None:
66+
"""Test if the output types are correct for counted and binary fingerprints."""
67+
mol_fp = MolToMorganFP(counted=False)
68+
self.assertEqual(mol_fp.output_type, "binary")
69+
mol_fp = MolToMorganFP(counted=True)
70+
self.assertEqual(mol_fp.output_type, "integer")
71+
72+
def test_return_value_types(self) -> None:
6673
"""Test equality of different output_types."""
6774

6875
smi2mol = SmilesToMol()

0 commit comments

Comments
 (0)