Commits

Anonymous committed 7a9697a

fixed test which had depended on a bug in the fingerprinter

Comments (0)

Files changed (1)

test_cyclops_mysql.py

 _check(sid1_substruct_fp, 374) # C(~H)(~H)(~H)
 
 sid6_substruct_fp = (
-    # [NH4+] so bit 0 , bit 14 ( and bit 299 () are set
+    # [NH4+]
     "014000000000000000000000000000000000000000000000000000000000"
-    "000000000000000800000000000000000000000000000800000000000000"
+    "000000000000000800000000000000000000000000000000000000000000"
     "000000000000000000000000000000000000000000000000000000000000"
     "000000000000000000000000000000000000000000")
 _check(sid6_substruct_fp, 0)   # >=4 H
 _check(sid6_substruct_fp, 14)  # >= 1 N
 _check(sid6_substruct_fp, 299) # N-H
-# What's the other one?
 
 
 class TestCyclopsSubstruct(unittest.TestCase):
         for i, (left, right) in enumerate(zip(fp1, fp2)):
             self.assertEquals(left, right, i)
         assert 0, "Should not get here"
-    def test_against_special(self):
+        
+    def test_against_special_targets(self):
         self.assertEquals(L("select cyclops_substruct_fp('[B]')")[0],
                           (B_substruct_fp,))
         self.assertEquals(L("select cyclops_substruct_fp('[U]')")[0],
                           (sid1_substruct_fp,))
         self.assertEquals(L("select cyclops_substruct_fp('[NH4+]')")[0],
                           (sid6_substruct_fp,))
+
+    def test_against_special_queries(self):
+        self.assertEquals(L("select cyclops_substruct_qfp('[B]')")[0],
+                          (B_substruct_qfp,))
+        self.assertEquals(L("select cyclops_substruct_qfp('[U]')")[0],
+                          (U_substruct_qfp,))
+        self.assertEquals(L("select cyclops_substruct_qfp('[U].[B]')")[0],
+                          (UB_substruct_qfp,))
+        self.assertEquals(L("select cyclops_substruct_qfp('C')")[0],
+                          (sid1_substruct_qfp,))
+        self.assertEquals(L("select cyclops_substruct_qfp('[NH4+]')")[0],
+                          (sid6_substruct_qfp,))
+
     def test_smiles_live_database(self):
         self.assertEquals(
             L("select cyclops_substruct_fp(smiles) from test_data where sid = 1"),