Merge "Fix unconfirm for swift backend"

This commit is contained in:
Jenkins 2017-08-11 06:52:32 +00:00 committed by Gerrit Code Review
commit 79069e31ff
2 changed files with 8 additions and 3 deletions

View File

@ -157,4 +157,4 @@ class SubscriptionController(storage.Subscription):
return self.get(queue, obj, project)
def confirm(self, queue, subscription_id, project=None, confirmed=True):
self.update(queue, subscription_id, project, confirmed=True)
self.update(queue, subscription_id, project, confirmed=confirmed)

View File

@ -1321,7 +1321,6 @@ class SubscriptionControllerTest(ControllerBaseTest):
s_id, self.project)
subscription = self.subscription_controller.get(self.source, s_id,
project=self.project)
self.assertFalse(subscription['confirmed'])
self.subscription_controller.confirm(self.source, s_id,
@ -1329,9 +1328,15 @@ class SubscriptionControllerTest(ControllerBaseTest):
confirmed=True)
subscription = self.subscription_controller.get(self.source, s_id,
project=self.project)
self.assertTrue(subscription['confirmed'])
self.subscription_controller.confirm(self.source, s_id,
project=self.project,
confirmed=False)
subscription = self.subscription_controller.get(self.source, s_id,
project=self.project)
self.assertFalse(subscription['confirmed'])
def test_confirm_with_nonexist_subscription(self):
s_id = 'fake-id'
self.assertRaises(errors.SubscriptionDoesNotExist,