Skip to content

Commit

Permalink
test: enable pubchem tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisborn committed Mar 21, 2023
1 parent fea29ce commit 44e9c02
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pytoda/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name = 'pytoda'
__version__ = '1.1.2'
__version__ = '1.1.3'
36 changes: 19 additions & 17 deletions pytoda/preprocessing/tests/test_crawlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from pytoda.preprocessing.crawlers import ( # query_pubchem,; remove_pubchem_smiles,
get_smiles_from_pubchem,
get_smiles_from_zinc,
remove_pubchem_smiles,
query_pubchem,
)


Expand Down Expand Up @@ -83,29 +85,29 @@ def test_get_smiles_from_pubchem(self) -> None:

def test_query_pubchem(self) -> None:
"""Test query_pubchem"""
pass
# pass
# Disabled due to bug in pubchem api
# smiles_list = [
# 'O1C=CC=NC(=O)C1=O',
# 'CC(N)S(O)(=O)C(C)CC(C(C)C)c1cc(F)cc(F)c1',
# 'Clc1ccccc2ccnc12',
# ]
# ground_truths = [(True, 67945516), (False, -2), (False, -1)]
# for gt, smiles in zip(ground_truths, smiles_list):
# self.assertTupleEqual(query_pubchem(smiles), gt)
smiles_list = [
'O1C=CC=NC(=O)C1=O',
'CC(N)S(O)(=O)C(C)CC(C(C)C)c1cc(F)cc(F)c1',
'Clc1ccccc2ccnc12',
]
ground_truths = [(True, 67945516), (False, -2), (False, -1)]
for gt, smiles in zip(ground_truths, smiles_list):
self.assertTupleEqual(query_pubchem(smiles), gt)

def test_remove_pubchem_smiles(self) -> None:
"""Test remove_pubchem_smiles"""
pass
# pass

# Disabled due to bug in pubchem api
# smiles_list = [
# 'O1C=CC=NC(=O)C1=O',
# 'CC(N)S(O)(=O)C(C)CC(C(C)C)c1cc(F)cc(F)c1',
# 'Clc1ccccc2ccnc12',
# ]
# ground_truth = ['CC(N)S(O)(=O)C(C)CC(C(C)C)c1cc(F)cc(F)c1', 'Clc1ccccc2ccnc12']
# self.assertListEqual(remove_pubchem_smiles(smiles_list), ground_truth)
smiles_list = [
'O1C=CC=NC(=O)C1=O',
'CC(N)S(O)(=O)C(C)CC(C(C)C)c1cc(F)cc(F)c1',
'Clc1ccccc2ccnc12',
]
ground_truth = ['CC(N)S(O)(=O)C(C)CC(C(C)C)c1cc(F)cc(F)c1', 'Clc1ccccc2ccnc12']
self.assertListEqual(remove_pubchem_smiles(smiles_list), ground_truth)


if __name__ == '__main__':
Expand Down

0 comments on commit 44e9c02

Please sign in to comment.