def test_write_bytes(filesystem: FileSystemImpl, lpaths: Dict[str, AbstractPath]) -> None: data = bytes('Hello, world!', 'utf-8') filesystem._write_bytes(lpaths['new_file'], data) content = filesystem._read_bytes(lpaths['new_file']) assert content == data filesystem._unlink(lpaths['new_file'])
def test_read_bytes(filesystem: FileSystemImpl, lpaths: Dict[str, AbstractPath]) -> None: content = filesystem._read_bytes(lpaths['file']) assert content == bytes('Hello World\n', 'utf-8')