Merge "Fix unconfirm for swift backend"
This commit is contained in:
commit
79069e31ff
@ -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)
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user