コード例 #1
0
    def test_complete_compound_entry(self):
        c = kegg.CompoundEntry({
            'entry': ['C00001        Compound'],
            'name': ['H2O;', 'Water'],
            'reaction': ['R00001 R00002', 'R00003'],
            'enzyme': ['1.2.3.4 2.3.4.5', '7.6.50.4 2.1.-,-'],
            'formula': ['H2O'],
            'exact_mass': ['18.01'],
            'mol_weight': ['18.01'],
            'pathway': ['map00001  First pathway', 'map00002  Second pathway'],
            'dblinks': ['CAS: 12345', 'ChEBI: B2345'],
            'comment': ['This information is purely for testing!']
        })

        self.assertEqual(c.id, 'C00001')
        self.assertEqual(c.name, 'H2O')
        self.assertEqual(list(c.names), ['H2O', 'Water'])
        self.assertEqual(list(c.reactions), ['R00001', 'R00002', 'R00003'])
        self.assertEqual(list(c.enzymes),
                         ['1.2.3.4', '2.3.4.5', '7.6.50.4', '2.1.-,-'])
        self.assertEqual(c.formula, 'H2O')
        self.assertAlmostEqual(c.exact_mass, 18.01)
        self.assertAlmostEqual(c.mol_weight, 18.01)
        self.assertEqual(list(c.pathways), [('map00001', 'First pathway'),
                                            ('map00002', 'Second pathway')])
        self.assertEqual(list(c.dblinks), [('CAS', '12345'),
                                           ('ChEBI', 'B2345')])
        self.assertEqual(c.comment, 'This information is purely for testing!')
コード例 #2
0
    def test_minimal_compound_entry(self):
        c = kegg.CompoundEntry(
            kegg.KEGGEntry({'entry': ['C00001        Compound']}))

        self.assertEqual(c.id, 'C00001')
        self.assertIsNone(c.properties['name'])
        self.assertIsNone(c.filemark)
コード例 #3
0
    def test_minimal_compound_entry(self):
        c = kegg.CompoundEntry({'entry': ['C00001        Compound']})

        self.assertEqual(c.id, 'C00001')
        self.assertIsNone(c.name)
        self.assertEqual(list(c.names), [])
        self.assertIsNone(c.formula)
        self.assertIsNone(c.exact_mass)
        self.assertIsNone(c.mol_weight)
        self.assertIsNone(c.comment)
        self.assertIsNone(c.filemark)