File: test_01_no_clean_session.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 (20 lines) | stat: -rw-r--r-- 577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Test whether a client produces a correct connect with clean session not set.

# The client should connect with keepalive=60, clean session not
# set, and client id 01-no-clean-session.


import tests.paho_test as paho_test

connect_packet = paho_test.gen_connect("01-no-clean-session", clean_session=False, keepalive=60)


def test_01_no_clean_session(server_socket, start_client):
    start_client("01-no-clean-session.py")

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

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

    conn.close()