Skip to content

Read on OverlayStream without a known size fails #114

@yunzheng

Description

@yunzheng

When OverlayStream is initialized without specifying the size, the read() call will return an empty buffer.

The following test case fails:

def test_overlay_stream_no_size() -> None:
    data = b"1234567890"
    buf = io.BytesIO(data)

1. Initialize without a size
       overlay = stream.OverlayStream(buf)

1. read exactly the size of the buffer
       overlay.seek(0)
       assert overlay.read(10) == data

1. read until EOF
       overlay.seek(0)
       assert overlay.read() == data

1. read until EOF using -1
       overlay.seek(0)
       assert overlay.read(-1) == data

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions