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