Skip to content

Commit

Permalink
Add the missing header in unsubscribe closing issue #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Élysson MR authored and wpjunior committed May 13, 2017
1 parent 1936590 commit 2076fa8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def test_nack(self):
def test_unsubscribe(self):
self.stomp.stream = MagicMock()

self.stomp.subscribe("queue/dummyqueue")
self.stomp.subscribe("/queue/dummyqueue")

last_subscribe_id = str(self.stomp._last_subscribe_id)
subscription = self.stomp._subscriptions[last_subscribe_id]
Expand All @@ -355,5 +355,6 @@ def test_unsubscribe(self):
self.assertEqual(
self.stomp.stream.write.call_args[0][0],
b'UNSUBSCRIBE\n'
b'id:1\n\n'
b'destination:/queue/dummyqueue\n'
b'id:1\n\n'
b'\x00')
1 change: 1 addition & 0 deletions torstomp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,6 @@ def _send_subscribe_frame(self, subscription):
def _send_unsubscribe_frame(self, subscription):
headers = {
'id': subscription.id,
'destination': subscription.destination
}
return self._send_frame('UNSUBSCRIBE', headers)

0 comments on commit 2076fa8

Please sign in to comment.