Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Nov 18, 2024
1 parent 3670f3e commit af7fc1e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/test_flowcontrol_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,13 @@ def test_flow_control_data_queue_feed_pause(
"""Test feeding data and pausing the reader."""
buffer._protocol._reading_paused = False
buffer.feed_data(object(), 100)

assert buffer._protocol.pause_reading.called

buffer._protocol._reading_paused = True
buffer._protocol.pause_reading.reset_mock()
buffer.feed_data(object(), 100)
assert not buffer._protocol.pause_reading.called


async def test_flow_control_data_queue_resume_on_read(
buffer: streams.FlowControlDataQueue,
Expand All @@ -167,3 +171,12 @@ async def test_flow_control_data_queue_resume_on_read(
buffer._protocol._reading_paused = True
await buffer.read()
assert buffer._protocol.resume_reading.called


async def test_flow_control_data_queue_read_eof(
buffer: streams.FlowControlDataQueue,
) -> None:
"""Test that reading after eof raises EofStream."""
buffer.feed_eof()
with pytest.raises(streams.EofStream):
await buffer.read()

0 comments on commit af7fc1e

Please sign in to comment.