Merge "Add unit test for quota defaults api"

This commit is contained in:
Zuul 2019-03-25 09:49:53 +00:00 committed by Gerrit Code Review
commit 1deb153e53
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, self.assertRaises(exc.HTTPBadRequest, self.controller.update,
req, '111', body=body) 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( @mock.patch(
'karbor.quota.DbQuotaDriver.get_project_quotas') 'karbor.quota.DbQuotaDriver.get_project_quotas')
def test_quota_detail(self, mock_quota_get): def test_quota_detail(self, mock_quota_get):