Skip to content

Commit 09203fa

Browse files
committed
Add test to reproduce googleapis#2878
1 parent bbb8310 commit 09203fa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pubsub/unit_tests/test_subscription.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import unittest
1616

17+
import mock
18+
1719

1820
class TestSubscription(unittest.TestCase):
1921
PROJECT = 'PROJECT'
@@ -745,6 +747,16 @@ def test___exit___(self):
745747
[ACK_ID1, ACK_ID2])
746748
self.assertIs(subscription._ack_client, CLIENT)
747749

750+
def test_empty_ack_no_acknowledge(self):
751+
subscription = mock.Mock(_FauxSubscription)
752+
subscription.pull = lambda *args: []
753+
754+
auto_ack = self._make_one(subscription)
755+
with auto_ack:
756+
pass
757+
758+
subscription.acknowledge.assert_not_called()
759+
748760

749761
class _FauxIAMPolicy(object):
750762

0 commit comments

Comments
 (0)