|
19 | 19 | from kafka.protocol.new.consumer import ( |
20 | 20 | OffsetCommitRequest, OffsetCommitResponse, |
21 | 21 | OffsetFetchRequest, OffsetFetchResponse, |
| 22 | + JoinGroupResponse, |
22 | 23 | ) |
23 | | -from kafka.protocol.group import GroupMember |
24 | 24 | from kafka.protocol.new.metadata import MetadataResponse |
25 | 25 | from kafka.structs import OffsetAndMetadata, TopicPartition |
26 | 26 | from kafka.util import WeakMethod |
@@ -207,8 +207,10 @@ def test_perform_assignment(mocker, coordinator): |
207 | 207 |
|
208 | 208 | ret = coordinator._perform_assignment( |
209 | 209 | 'member-foo', 'roundrobin', |
210 | | - [GroupMember(member, None, subscription.encode()) |
211 | | - for member, subscription in group_subscriptions.items()]) |
| 210 | + [JoinGroupResponse.JoinGroupResponseMember( |
| 211 | + member_id=member_id, |
| 212 | + metadata=subscription.encode(), |
| 213 | + ) for member_id, subscription in group_subscriptions.items()]) |
212 | 214 |
|
213 | 215 | assert RoundRobinPartitionAssignor.assign.call_count == 1 |
214 | 216 | RoundRobinPartitionAssignor.assign.assert_called_with( |
@@ -302,7 +304,7 @@ def test_close(mocker, coordinator): |
302 | 304 | assert coordinator._maybe_auto_commit_offsets_sync.call_count == 1 |
303 | 305 | coordinator._handle_leave_group_response.assert_called_with('foobar') |
304 | 306 |
|
305 | | - assert coordinator.generation() is None |
| 307 | + assert coordinator.generation_if_stable() is None |
306 | 308 | assert coordinator._generation == Generation.NO_GENERATION |
307 | 309 | assert coordinator.state is MemberState.UNJOINED |
308 | 310 | assert coordinator.rejoin_needed is True |
|
0 commit comments