From d2c2cf68b84e320e0c5d2c49afa72966c381412a Mon Sep 17 00:00:00 2001 From: zhaodan Date: Tue, 18 Dec 2018 16:50:15 +0800 Subject: [PATCH] add test for quota update when quota no exist Closes-Bug: #1808940 Change-Id: Ib4ad6138edc49b334a7a2da1c7864d874bf9a0eb --- mogan/tests/unit/db/test_quotas.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mogan/tests/unit/db/test_quotas.py b/mogan/tests/unit/db/test_quotas.py index 1f06f587..26ec59d8 100644 --- a/mogan/tests/unit/db/test_quotas.py +++ b/mogan/tests/unit/db/test_quotas.py @@ -104,6 +104,14 @@ class DbQuotaTestCase(base.DbTestCase): {'hard_limit': new_limit}) self.assertEqual(new_limit, res.hard_limit) + def test_quota_update_not_exist(self): + self.assertRaises(exception.QuotaNotFound, + self.dbapi.quota_update, + self.context, + '123', + 'fake', + {'hard_limit': 100}) + def test_quota_update_with_invalid_parameter_value(self): quota = utils.create_test_quota() self.assertRaises(exception.InvalidParameterValue,