def test_api_open_binary_read(with_adapter: str, bucket: str) -> None: path = Pathy(f"gs://{bucket}/read_binary/file.txt") path.write_bytes(b"---") with path.open(mode="rb") as file_obj: assert file_obj.readlines() == [b"---"] with path.open(mode="rb") as file_obj: assert file_obj.readline() == b"---" assert file_obj.readline() == b""
def test_api_readwrite_bytes(with_adapter: str, bucket: str) -> None: path = Pathy(f"gs://{bucket}/write_bytes/file.txt") path.write_bytes(b"---") assert path.read_bytes() == b"---"