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