summaryrefslogtreecommitdiff
path: root/test/test_consumer.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2017-03-13 12:42:47 -0700
committerGitHub <noreply@github.com>2017-03-13 12:42:47 -0700
commitce57dac0c6c620371a1c484b9619e2deb83be82e (patch)
treeca8ec78932b552adca256c71d226214274bf3146 /test/test_consumer.py
parent899f11730db5f209c03cfad20111ec131ee4c70b (diff)
downloadkafka-python-ce57dac0c6c620371a1c484b9619e2deb83be82e.tar.gz
Return copy of consumer subscription set (#1029)
Diffstat (limited to 'test/test_consumer.py')
-rw-r--r--test/test_consumer.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_consumer.py b/test/test_consumer.py
index 073a3af..e5dd946 100644
--- a/test/test_consumer.py
+++ b/test/test_consumer.py
@@ -24,6 +24,14 @@ class TestKafkaConsumer(unittest.TestCase):
with self.assertRaises(KafkaConfigurationError):
KafkaConsumer(bootstrap_servers='localhost:9092', fetch_max_wait_ms=41000, request_timeout_ms=40000)
+ def test_subscription_copy(self):
+ consumer = KafkaConsumer('foo', api_version=(0, 10))
+ sub = consumer.subscription()
+ assert sub is not consumer.subscription()
+ assert sub == set(['foo'])
+ sub.add('fizz')
+ assert consumer.subscription() == set(['foo'])
+
class TestMultiProcessConsumer(unittest.TestCase):
@unittest.skipIf(sys.platform.startswith('win'), 'test mocking fails on windows')