Skip to content

Commit

Permalink
Revert the chem tests to master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnathan Schaff committed Feb 29, 2024
1 parent 690aeda commit e5f0dc0
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions tests/chem.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def test_getchem_with_fields(self):
self.assertTrue("pubchem" in c)
self.assertTrue("cid" in c["pubchem"])

@unittest.expectedFailure
def get_getdrug(self):
c = self.mc.getdrug("CHEMBL1308")
self.assertEqual(c["_id"], "ZRALSGWEFCBTJO-UHFFFAOYSA-N")
Expand All @@ -65,10 +64,10 @@ def get_getdrug(self):

# PubChem CID
# not working yet
c = self.mc.getdrug("CID:1990")
self.assertEqual(c["_id"], "ZRALSGWEFCBTJO-UHFFFAOYSA-N")
c = self.mc.getdrug("1990")
self.assertEqual(c["_id"], "ZRALSGWEFCBTJO-UHFFFAOYSA-N")
# c = self.mc.getdrug("CID:1990")
# self.assertEqual(c['_id'], "ZRALSGWEFCBTJO-UHFFFAOYSA-N")
# c = self.mc.getdrug("1990")
# self.assertEqual(c['_id'], "ZRALSGWEFCBTJO-UHFFFAOYSA-N")

def test_getchems(self):
c_li = self.mc.getchems(
Expand Down Expand Up @@ -103,17 +102,16 @@ def test_query_chembl(self):
self.assertEqual(len(qres["hits"]), 1)
self.assertEqual(qres["hits"][0]["_id"], "RRUDCFGSUDOHDG-UHFFFAOYSA-N")

@unittest.expectedFailure
def test_query_drugcentral(self):
qres = self.mc.query("drugcentral.drug_use.contraindication.umls_cui:C0023530", fields="drugcentral", size=50)
self.assertTrue("hits" in qres)
self.assertEqual(len(qres["hits"]), 50)

# not working yet
qres = self.mc.query("drugcentral.xrefs.kegg_drug:D00220")
self.assertTrue("hits" in qres)
self.assertEqual(len(qres["hits"]), 1)
self.assertEqual(qres["hits"][0]["_id"], "ZRALSGWEFCBTJO-UHFFFAOYSA-N")
# qres = self.mc.query('drugcentral.xrefs.kegg_drug:D00220')
# self.assertTrue('hits' in qres)
# self.assertEqual(len(qres['hits']), 1)
# self.assertEqual(qres['hits'][0]['_id'], 'ZRALSGWEFCBTJO-UHFFFAOYSA-N')

def test_query_pubchem(self):
qres = self.mc.query("pubchem.molecular_formula:C2H5NO2", fields="pubchem", size=20)
Expand Down Expand Up @@ -141,15 +139,15 @@ def test_query_ndc(self):
qres = self.mc.query('ndc.productndc:"27437-051"')
self.assertTrue("hits" in qres)
self.assertEqual(len(qres["hits"]), 1)
self.assertEqual(qres["hits"][0]["_id"], "KPQZUUQMTUIKBP-UHFFFAOYSA-N")
# Temp disable this check till we fix the data issue
# self.assertEqual(qres['hits'][0]['_id'], 'KPQZUUQMTUIKBP-UHFFFAOYSA-N')

@unittest.expectedFailure
def test_query_sider(self):
qres = self.mc.query("sider.meddra.umls_id:C0232487", fields="sider", size=5)
self.assertTrue("hits" in qres)
self.assertEqual(len(qres["hits"]), 5)
# Temp disable this check till we fix the data issue
self.assertEqual(qres["hits"][0]["_id"], "ZRALSGWEFCBTJO-UHFFFAOYSA-N")
# self.assertEqual(qres['hits'][0]['_id'], 'ZRALSGWEFCBTJO-UHFFFAOYSA-N')

def test_query_unii(self):
qres = self.mc.query("unii.unii:JU58VJ6Y3B")
Expand Down

0 comments on commit e5f0dc0

Please sign in to comment.