def test_read_boundary_case1(): img = Image(Section(data=bytearray(5), start_address=0x1000)) assert img.read(0x1000, 5) == b"\x00\x00\x00\x00\x00"
def test_read_boundary_case3(): img = Image(Section(data=bytearray(5), start_address=0x1000)) with pytest.raises(InvalidAddressError): img.read(0x0fff, 5)
def test_read_write(): img = Image(Section(data=bytearray(32), start_address=0x1000)) img.write(0x1000, b'hello') assert img.read(0x1000, 5) == b"hello"