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 ClusterMetadata request_update() #1056

Merged
merged 11 commits into from
Oct 21, 2024
Prev Previous commit
black fml.
jackgene committed Oct 12, 2024
commit 3fe7787c7c47ddf8ddbdd562f14eb522e8572b2b
8 changes: 5 additions & 3 deletions tests/test_cluster.py
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ def test_empty_broker_list():
)
assert len(cluster.brokers()) == 2


def test_request_update_expecting_success():
cluster = ClusterMetadata()
updated_cluster = cluster.request_update()
@@ -28,12 +29,13 @@ def test_request_update_expecting_success():
)
assert updated_cluster.result() == cluster


def test_request_update_expecting_failure():
cluster = ClusterMetadata()
updated_cluster = cluster.request_update()
test_metadata = MetadataResponse[0](
[], # empty brokers
[(17, "foo", []), (17, "bar", [])], # topics w/ error
)
[], # empty brokers
[(17, "foo", []), (17, "bar", [])], # topics w/ error
)
cluster.update_metadata(test_metadata)
assert updated_cluster.exception() is not None
Loading