Skip to content

Commit

Permalink
More testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
eerimoq committed May 11, 2019
1 parent a78c6e9 commit 6058df6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ async def client_main():

await asyncio.wait_for(asyncio.gather(broker_main(), client_main()), 1)

def test_client_id(self):
client = mqttools.Client('localhost', 0)
self.assertEqual(client.client_id[:9], 'mqttools-')



logging.basicConfig(level=logging.DEBUG)

Expand Down
12 changes: 12 additions & 0 deletions tests/test_mqttools.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,18 @@ def test_receive_topic_alias(self):
('c2s', b'\x82\x18\x00\x01\x00\x00\x12/test/mqttools/foo\x00'),
# SUBACK
('s2c', b'\x90\x04\x00\x01\x00\x00'),
# PUBLISH using an unknown alias 1
(
's2c',
b'\x30\x22\x00\x00\x03\x23\x00\x01published-with-unknown-alias'
),
# PUBLISH using alias an invalid alias 6
(
's2c',
b'\x30\x34\x00\x12/test/mqttools/foo\x03\x23\x00\x06'
b'sets-invalid-alias-in-client'
),

# PUBLISH to set alias
(
's2c',
Expand Down

0 comments on commit 6058df6

Please sign in to comment.