Example #1
0
 def test_create_topic(self):
     name = uuid.uuid4()
     topic = Topic(name=name, zookeeper_host="sandbox.hortonworks.com:2181")
     self.assertFalse(topic.is_exists())
     Kafka.create_topic(name=name, replication_factor=1,
                        partitions=1,
                        zookeeper_host="sandbox.hortonworks.com:2181")
     self.assertTrue(topic.is_exists())
     self.assertTrue(str(name) in topic.get_metadata())
     topic.delete()
Example #2
0
 def test_create_topic(self):
     name = uuid.uuid4()
     topic = Topic(name=name, zookeeper_host="sandbox.hortonworks.com:2181")
     self.assertFalse(topic.is_exists())
     Kafka.create_topic(name=name,
                        replication_factor=1,
                        partitions=1,
                        zookeeper_host="sandbox.hortonworks.com:2181")
     self.assertTrue(topic.is_exists())
     self.assertTrue(str(name) in topic.get_metadata())
     topic.delete()