Exemple #1
0
    def test_compare(self):
        inchi1 = InChI('InChI=1S/foo')
        inchi2 = InChI('InChI=1/foo')
        inchi3 = InChI('InChI=1/bar')

        self.assertTrue(inchi1 == inchi2)
        self.assertTrue(not inchi1 != inchi2)

        self.assertTrue((inchi1 < inchi2) is (inchi1 > inchi2))
        self.assertTrue((inchi1 < inchi3) is not (inchi1 > inchi3))
Exemple #2
0
    def test_constructor(self):
        inchi1 = InChI('InChI=1S/foo')
        self.assertTrue(inchi1 is not None)

        with self.assertRaises(InchiException):
            InChI('foo')