Skip to content

Commit

Permalink
add test to clarify how to touch messages twice
Browse files Browse the repository at this point in the history
  • Loading branch information
pyeremenko authored and featalion committed Mar 25, 2015
1 parent f1926ab commit 33428ee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test.py
Expand Up @@ -52,6 +52,17 @@ def test_touchMessage(self):
response = q.touch(message["messages"][0]["id"], message["messages"][0]["reservation_id"])
self.assertEqual("Touched", response["msg"])

def test_touchMessageTwice(self):
msg = "Test message %s" % time.time()
q = self.mq.queue("test_queue")
q.clear()
id = q.post(msg)
message = q.reserve()
response = q.touch(message["messages"][0]["id"], message["messages"][0]["reservation_id"])
# use new reservation_id
response = q.touch(message["messages"][0]["id"], response["reservation_id"])
self.assertEqual("Touched", response["msg"])

def test_releaseMessage(self):
msg = "Test message %s" % time.time()
q = self.mq.queue("test_queue")
Expand Down

0 comments on commit 33428ee

Please sign in to comment.