File: test_01_unpwd_empty_set.py

package info (click to toggle)
python-paho-mqtt 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,248 kB
  • sloc: python: 8,765; sh: 48; makefile: 40
file content (21 lines) | stat: -rw-r--r-- 608 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Test whether a client produces a correct connect with a username and password.

# The client should connect with keepalive=60, clean session set,
# client id 01-unpwd-set, username and password set to empty string.


import tests.paho_test as paho_test

connect_packet = paho_test.gen_connect(
    "01-unpwd-set", keepalive=60, username="", password='')


def test_01_unpwd_empty_set(server_socket, start_client):
    start_client("01-unpwd-empty-set.py")

    (conn, address) = server_socket.accept()
    conn.settimeout(10)

    paho_test.expect_packet(conn, "connect", connect_packet)

    conn.close()