forked from corinnabrungs/msn_tree_library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_chembl_client.py
32 lines (26 loc) · 978 Bytes
/
test_chembl_client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from unittest import TestCase
import pandas as pd
import chembl_client
class Test(TestCase):
def test_get_chembl_mol(self):
comp = chembl_client.get_chembl_mol(
None, inchikey="BSYNRYMUTXBXSQ-UHFFFAOYSA-N"
)
assert comp is not None
assert comp["max_phase"] == "4.0"
assert comp["oral"] == True
assert comp["pref_name"] == "ASPIRIN"
def test_chembl_search_id_and_inchikey(self):
df = pd.DataFrame(
[
{
"smiles": "CC(=O)Oc1ccccc1C(=O)O",
"inchikey": "BSYNRYMUTXBXSQ-UHFFFAOYSA-N",
"inchi": "InChI=1S/C9H8O4/c1-6(10)13-8-5-3-2-4-7(8)9(11)12/h2-5H,1H3,(H,11,12)",
}
]
)
df = chembl_client.chembl_search_id_and_inchikey(df)
cols = ["chembl_alogp", "indication", "oral", "first_approval", "prodrug"]
for col in cols:
assert col in df.columns