From ebcffa8fda90c0bbd6c0a1071bf2960176c37b55 Mon Sep 17 00:00:00 2001 From: Peter Law Date: Sun, 4 Aug 2024 20:50:18 +0100 Subject: [PATCH] Have FakeAIOKafkaConsumer.topics better match the real behaviour AIOKafkaConsumer.topics returns all the topics which the user can see within the connected Kafka instance. Since our mock doesn't handle any form of authentication/ACLs, just return all known topics. --- mockafka/aiokafka/aiokafka_consumer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mockafka/aiokafka/aiokafka_consumer.py b/mockafka/aiokafka/aiokafka_consumer.py index ca8a677..c83a0ce 100644 --- a/mockafka/aiokafka/aiokafka_consumer.py +++ b/mockafka/aiokafka/aiokafka_consumer.py @@ -112,7 +112,7 @@ async def commit(self): self.consumer_store = {} async def topics(self) -> set[str]: - return set(self.subscribed_topic) + return set(self.kafka.topic_list()) def subscribe( self,