def test_get_brokers_no_match(self): """Test getting the number of Kafka brokers with pattern & no match""" brokers = kafka.get_brokers('test', 'tm.zzz.com', self.zkclient_mock, app_pattern='proid.kafka.*') self.assertEquals(len(brokers), 0)
def test_get_brokers_with_masters(self): """Test getting the number of Kafka brokers with masters""" brokers = kafka.get_brokers('test', 'tm.xxx.com', self.zkclient_mock, app_pattern='foo.kafka.*') self.assertEquals(len(brokers), 1)
def test_get_brokers_from_cell(self): """Test getting the number of Kafka brokers from cell""" brokers = kafka.get_brokers('test', 'tm.xxx.com', self.zkclient_mock, app_pattern='foo.kafka.*') self.assertEqual(len(brokers), 1)
def test_get_brokers_no_pattern(self): """Test getting the number of Kafka brokers with no pattern & match""" # No pattern, use default pattern brokers = kafka.get_brokers('test', 'tm.xxx.com', self.zkclient_mock) self.assertEqual(len(brokers), 2)