Example #1
0
    def test_resource_data_delete(self):
        create_resource_data(self.ctx, self.resource)
        res_data = db_api.resource_data_get_by_key(self.ctx, self.resource.id,
                                                   'test_resource_key')
        self.assertIsNotNone(res_data)
        self.assertEqual('test_value', res_data.value)

        db_api.resource_data_delete(self.resource, 'test_resource_key')
        self.assertRaises(exception.NotFound, db_api.resource_data_get_by_key,
                          self.ctx, self.resource.id, 'test_resource_key')
        self.assertIsNotNone(res_data)
Example #2
0
    def test_resource_data_delete(self):
        create_resource_data(self.ctx, self.resource)
        res_data = db_api.resource_data_get_by_key(self.ctx, self.resource.id,
                                                   'test_resource_key')
        self.assertIsNotNone(res_data)
        self.assertEqual('test_value', res_data.value)

        db_api.resource_data_delete(self.resource, 'test_resource_key')
        self.assertRaises(exception.NotFound, db_api.resource_data_get_by_key,
                          self.ctx, self.resource.id, 'test_resource_key')
        self.assertIsNotNone(res_data)
Example #3
0
 def resource_properties(self, res, prop_name):
     res_data = db_api.resource_data_get_by_key(self.cntxt,
                                                res.id,
                                                prop_name)
     return res_data.value
Example #4
0
 def resource_properties(self, res, prop_name):
     res_data = db_api.resource_data_get_by_key(self.cntxt, res.id,
                                                prop_name)
     return res_data.value
Example #5
0
 def get_by_key(cls, context, resource_id, key):
     db_rdata = db_api.resource_data_get_by_key(context, resource_id, key)
     return cls._from_db_object(cls(context), db_rdata)
Example #6
0
 def get_by_key(cls, context, resource_id, key):
     db_rdata = db_api.resource_data_get_by_key(context, resource_id, key)
     return cls._from_db_object(cls(context), db_rdata)