def get_definition(self): '''Returns definition''' definition = parsers.get_definition(self.__chebi_id) if definition is None: definition = parsers.get_definition(self.get_parent_id()) if definition is None: for parent_or_child_id in self.__get_all_ids(): definition = parsers.get_definition(parent_or_child_id) if definition is not None: break return definition
def test_get_definition_null(self): '''COMMENT''' self.assertIsNone(parsers.get_definition(18945))
def test_get_definition_neg(self): '''COMMENT''' self.assertIsNone(parsers.get_definition(-1))
def test_get_definition(self): '''COMMENT''' definition = 'A glycerophosphocholine having an unspecified acyl ' + \ 'group attached at the 2-position.' self.assertEquals(definition, parsers.get_definition(11502))