def test_group_protocols(coordinator):
    # Requires a subscription
    try:
        coordinator.group_protocols()
    except __HOLE__:
        pass
    else:
        assert False, 'Exception not raised when expected'

    coordinator._subscription.subscribe(topics=['foobar'])
    assert coordinator.group_protocols() == [
        ('range', ConsumerProtocolMemberMetadata(
            RangePartitionAssignor.version,
            ['foobar'],
            b'')),
        ('roundrobin', ConsumerProtocolMemberMetadata(
            RoundRobinPartitionAssignor.version,
            ['foobar'],
            b'')),
    ]
dataset/ETHPy150Open dpkp/kafka-python/test/test_coordinator.py/test_group_protocols