def test_valid_input(arg1):
    expected = bytearray([0xFF, 0xFF, 0x00, 0x25, 0x00, 0x03,
                          (arg1 >> 8), (arg1 & 0xFF)])
    expected.append((sum(expected[2:]) & 0xFF) ^ 0xFF)

    request = SetInactivityTimeout(arg1)
    assert request.tobytes() == expected
Beispiel #2
0
def test_valid_input(arg1):
    expected = bytearray(
        [0xFF, 0xFF, 0x00, 0x25, 0x00, 0x03, (arg1 >> 8), (arg1 & 0xFF)])
    expected.append((sum(expected[2:]) & 0xFF) ^ 0xFF)

    request = SetInactivityTimeout(arg1)
    assert request.tobytes() == expected
def test_example_input():
    expected = bytearray([0xFF, 0xFF, 0x00, 0x25, 0x00, 0x03, 0x04, 0xD2, 0x01])
    request = SetInactivityTimeout(1234)
    assert request.tobytes() == expected
def test_input_below_range(arg1):
    request = SetInactivityTimeout(arg1)

    with pytest.raises(ValueError):
        request.tobytes()
Beispiel #5
0
def test_example_input():
    expected = bytearray(
        [0xFF, 0xFF, 0x00, 0x25, 0x00, 0x03, 0x04, 0xD2, 0x01])
    request = SetInactivityTimeout(1234)
    assert request.tobytes() == expected
Beispiel #6
0
def test_input_below_range(arg1):
    request = SetInactivityTimeout(arg1)

    with pytest.raises(ValueError):
        request.tobytes()