def test_quota_class_get_default(self):
        params = {"test_resource1": "10", "test_resource2": "20", "test_resource3": "30"}
        for res, limit in params.items():
            db_api.quota_class_create(self.ctx, "default", res, limit)

        defaults = db_api.quota_class_get_default(self.ctx)
        self.assertIn("test_resource1", defaults)
        self.assertIn("test_resource2", defaults)
        self.assertIn("test_resource3", defaults)
Beispiel #2
0
    def test_quota_class_get_default(self):
        params = {
            'test_resource1': '10',
            'test_resource2': '20',
            'test_resource3': '30',
        }
        for res, limit in params.items():
            db_api.quota_class_create(self.ctx, 'default', res, limit)

        defaults = db_api.quota_class_get_default(self.ctx)
        self.assertIn('test_resource1', defaults)
        self.assertIn('test_resource2', defaults)
        self.assertIn('test_resource3', defaults)
Beispiel #3
0
 def create_quota_class(ctxt, **kwargs):
     values = {
         'class_name': "test_class",
         'resource': "ram",
         'limit': 10,
     }
     values.update(kwargs)
     return db_api.quota_class_create(ctxt, **values)
 def create_quota_class(ctxt, **kwargs):
     values = {"class_name": "test_class", "resource": "ram", "limit": 10}
     values.update(kwargs)
     return db_api.quota_class_create(ctxt, **values)