Skip to content

Commit

Permalink
added assertions to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Dec 16, 2024
1 parent d14a0c6 commit c2e9596
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/unit/test_bidi.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ def test_close(self):
# ensure the request queue was signaled to stop.
assert bidi_rpc.pending_requests == 1
assert bidi_rpc._request_queue.get() is None
# ensure request and callbacks are cleaned up
assert bidi_rpc._initial_request is None
assert not bidi_rpc._callbacks

def test_close_no_rpc(self):
bidi_rpc = bidi.BidiRpc(None)
Expand Down Expand Up @@ -623,6 +626,8 @@ def cancel_side_effect():
assert bidi_rpc.pending_requests == 1
assert bidi_rpc._request_queue.get() is None
assert bidi_rpc._finalized
assert bidi_rpc._initial_request is None
assert not bidi_rpc._callbacks

def test_reopen_failure_on_rpc_restart(self):
error1 = ValueError("1")
Expand Down Expand Up @@ -777,6 +782,7 @@ def on_response(response):
consumer.stop()

assert consumer.is_active is False
assert consumer._on_response is None

def test_wake_on_error(self):
should_continue = threading.Event()
Expand Down Expand Up @@ -884,6 +890,7 @@ def close_side_effect():

consumer.stop()
assert consumer.is_active is False
assert consumer._on_response is None

# calling stop twice should not result in an error.
consumer.stop()

0 comments on commit c2e9596

Please sign in to comment.