Beispiel #1
0
    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
Beispiel #2
0
 def test_get_parent_id_undefined(self):
     '''COMMENT'''
     self.assertTrue(math.isnan(parsers.get_parent_id(41100)))
Beispiel #3
0
 def test_get_parent_id_neg(self):
     '''COMMENT'''
     self.assertTrue(math.isnan(parsers.get_parent_id(-1)))
Beispiel #4
0
 def test_get_parent_id(self):
     '''COMMENT'''
     self.assertEquals(34107, parsers.get_parent_id(76262))
Beispiel #5
0
 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)
 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))