Browse Source

Add unit test for quota defaults api

Change-Id: I1a945f79cd816668c94ece2857ee82186f393ca5
changes/01/647301/1
lipanpan 2 years ago
parent
commit
fed1afa828
  1. 10
      karbor/tests/unit/api/v1/test_quotas.py

10
karbor/tests/unit/api/v1/test_quotas.py

@ -49,6 +49,16 @@ class QuotaApiTest(base.TestCase):
self.assertRaises(exc.HTTPBadRequest, self.controller.update,
req, '111', body=body)
@mock.patch(
'karbor.quota.DbQuotaDriver.get_defaults')
def test_quota_defaults(self, mock_quota_get):
req = fakes.HTTPRequest.blank(
'v1/quotas/73f74f90a1754bd7ad658afb3272323f',
use_admin_context=True)
self.controller.defaults(
req, '73f74f90a1754bd7ad658afb3272323f')
self.assertTrue(mock_quota_get.called)
@mock.patch(
'karbor.quota.DbQuotaDriver.get_project_quotas')
def test_quota_detail(self, mock_quota_get):

Loading…
Cancel
Save