Add unittest to api of quotas

Change-Id: I1f7c66a61b0f769bd589126abe8ec28b514361da
This commit is contained in:
hulina 2019-03-18 16:41:49 +08:00
parent 71a7695175
commit bb9625f2c3
1 changed files with 10 additions and 0 deletions

View File

@ -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_project_quotas')
def test_quota_detail(self, mock_quota_get):
req = fakes.HTTPRequest.blank(
'/v1/quotas/73f74f90a1754bd7ad658afb3272323f',
use_admin_context=True)
self.controller.detail(
req, '73f74f90a1754bd7ad658afb3272323f')
self.assertTrue(mock_quota_get.called)
@mock.patch(
'karbor.quota.DbQuotaDriver.get_project_quotas')
def test_quota_show(self, moak_quota_get):