Skip to content

Commit 809330f

Browse files
committed
added test for on_snapshot while closing
1 parent c7feaa1 commit 809330f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/unit/v1/test_watch.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,15 @@ def test_watch_on_snapshot_target_w_none():
400400
assert inst._rpc is None
401401

402402

403+
def test_watch_on_snapshot_while_closing():
404+
inst = _make_watch()
405+
inst.close = mock.Mock()
406+
with inst._closing:
407+
inst.on_snapshot(mock.Mock())
408+
# close should not be called again when already closing
409+
inst.close.assert_not_called()
410+
411+
403412
def test_watch_on_snapshot_target_no_change_no_target_ids_not_current():
404413
inst = _make_watch()
405414
proto = _make_listen_response()

0 commit comments

Comments
 (0)