Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tvoinarovskyi committed Feb 14, 2017
1 parent 4a17572 commit da7ddbc
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/test_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def test_consumer_subscribe_pattern_with_autocreate(self):
# Wait for consumer to refresh metadata with new topic
yield from asyncio.sleep(0.3, loop=self.loop)
self.assertFalse(consume_task.done())
self.assertEqual(consumer._client.cluster.topics(), {my_topic})
self.assertTrue(consumer._client.cluster.topics() >= {my_topic})
self.assertEqual(consumer.subscription(), {my_topic})

# Add another topic
Expand All @@ -607,8 +607,8 @@ def test_consumer_subscribe_pattern_with_autocreate(self):
# Wait for consumer to refresh metadata with new topic
yield from asyncio.sleep(0.3, loop=self.loop)
self.assertFalse(consume_task.done())
self.assertEqual(consumer._client.cluster.topics(), {
my_topic, my_topic2})
self.assertTrue(consumer._client.cluster.topics() >=
{my_topic, my_topic2})
self.assertEqual(consumer.subscription(), {my_topic, my_topic2})

# Now lets actualy produce some data and verify that it is consumed
Expand Down Expand Up @@ -689,7 +689,7 @@ def test_consumer_rebalance_on_new_topic(self):
@run_until_complete
def test_exclude_internal_topics(self):
# Create random topic
my_topic = "some_topic"
my_topic = "some_noninternal_topic"
client = AIOKafkaClient(
loop=self.loop, bootstrap_servers=self.hosts,
client_id="test_autocreate")
Expand All @@ -706,9 +706,7 @@ def test_exclude_internal_topics(self):
exclude_internal_topics=False)
consumer.subscribe(pattern=pattern)
yield from consumer.start()
self.assertEqual(consumer.subscription(),
{"some_topic", "__consumer_offsets"})
self.assertIn("__consumer_offsets", consumer.subscription())
yield from consumer._client.force_metadata_update()
self.assertEqual(consumer.subscription(),
{"some_topic", "__consumer_offsets"})
self.assertIn("__consumer_offsets", consumer.subscription())
yield from consumer.stop()

0 comments on commit da7ddbc

Please sign in to comment.