diff options
| author | Dana Powers <dana.powers@gmail.com> | 2018-01-09 16:56:41 -0800 |
|---|---|---|
| committer | Dana Powers <dana.powers@gmail.com> | 2018-01-11 13:33:20 -0800 |
| commit | 939551922244788822d0e778dd0e30851e88cd09 (patch) | |
| tree | 5cedfe77c741684f9d57334ad81923c4eab7dfc0 | |
| parent | a69320b8e3199fa9d7cfa3947a242e699a045c3b (diff) | |
| download | kafka-python-939551922244788822d0e778dd0e30851e88cd09.tar.gz | |
Test ensure active group
| -rw-r--r-- | test/test_coordinator.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_coordinator.py b/test/test_coordinator.py index 7dc0e04..f567369 100644 --- a/test/test_coordinator.py +++ b/test/test_coordinator.py @@ -620,3 +620,16 @@ def test_lookup_coordinator_failure(mocker, coordinator): return_value=Future().failure(Exception('foobar'))) future = coordinator.lookup_coordinator() assert future.failed() + + +def test_ensure_active_group(mocker, coordinator): + coordinator._subscription.subscribe(topics=['foobar']) + mocker.patch.object(coordinator, 'coordinator_unknown', return_value=False) + mocker.patch.object(coordinator, '_send_join_group_request', return_value=Future().success(True)) + mocker.patch.object(coordinator, 'need_rejoin', side_effect=[True, True, False]) + mocker.patch.object(coordinator, '_on_join_complete') + mocker.patch.object(coordinator, '_heartbeat_thread') + + coordinator.ensure_active_group() + + coordinator._send_join_group_request.assert_called_once_with() |
