Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix branch coverage for un-called callbacks. #6242

Merged
merged 1 commit into from
Oct 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions api_core/tests/unit/test_bidi.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ def cancel(self):

class TestResumableBidiRpc(object):
def test_initial_state(self):
bidi_rpc = bidi.ResumableBidiRpc(None, lambda _: True)
callback = mock.Mock()
callback.return_value = True
bidi_rpc = bidi.ResumableBidiRpc(None, callback)

assert bidi_rpc.is_active is False

Expand Down Expand Up @@ -380,7 +382,9 @@ def test_recv_recover_already_recovered(self):
grpc.StreamStreamMultiCallable,
instance=True,
side_effect=[call_1, call_2])
bidi_rpc = bidi.ResumableBidiRpc(start_rpc, lambda _: True)
callback = mock.Mock()
callback.return_value = True
bidi_rpc = bidi.ResumableBidiRpc(start_rpc, callback)

bidi_rpc.open()

Expand Down