def __get_all_ids(self): '''Returns all ids''' if self.__all_ids is None: parent_id = parsers.get_parent_id(self.__chebi_id) self.__all_ids = parsers.get_all_ids( self.__chebi_id if math.isnan(parent_id) else parent_id) if self.__all_ids is None: self.__all_ids = [] return self.__all_ids
def test_get_parent_id_undefined(self): '''COMMENT''' self.assertTrue(math.isnan(parsers.get_parent_id(41100)))
def test_get_parent_id_neg(self): '''COMMENT''' self.assertTrue(math.isnan(parsers.get_parent_id(-1)))
def test_get_parent_id(self): '''COMMENT''' self.assertEquals(34107, parsers.get_parent_id(76262))
def get_parent_id(self): '''Returns parent id''' parent_id = parsers.get_parent_id(self.__chebi_id) return None if math.isnan(parent_id) else 'CHEBI:' + str(parent_id)