Esempio n. 1
0
def test_get_address0():
    """setting and retrieving an 8bit address on a iframe."""
    iframe = IFrame()
    iframe.set_address(bytes([42]))
    assert bytes([42]) == iframe.get_address()
Esempio n. 2
0
def test_set_address4():
    """setting 'all station' should work"""
    iframe = IFrame()
    iframe.set_address(bytes([255]))
    assert iframe.is_allstation() is True
Esempio n. 3
0
def test_set_address2():
    """giving int as address should fail"""
    iframe = IFrame()
    with pytest.raises(TypeError):
        iframe.set_address(42)
Esempio n. 4
0
def test_set_address3():
    """giving string as address should fail"""
    iframe = IFrame()
    with pytest.raises(TypeError):
        iframe.set_address('23')
Esempio n. 5
0
def test_set_address1():
    """setting an arbitary 8bit address with clear MSB should work."""
    iframe = IFrame()
    iframe.set_address(bytes([42]))