예제 #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()
예제 #2
0
def test_set_address4():
    """setting 'all station' should work"""
    iframe = IFrame()
    iframe.set_address(bytes([255]))
    assert iframe.is_allstation() is True
예제 #3
0
def test_set_address2():
    """giving int as address should fail"""
    iframe = IFrame()
    with pytest.raises(TypeError):
        iframe.set_address(42)
예제 #4
0
def test_set_address3():
    """giving string as address should fail"""
    iframe = IFrame()
    with pytest.raises(TypeError):
        iframe.set_address('23')
예제 #5
0
def test_set_address1():
    """setting an arbitary 8bit address with clear MSB should work."""
    iframe = IFrame()
    iframe.set_address(bytes([42]))