def setUp(self): # Dummy client for testing - we're not going to connect that bootstrap broker self.client = Client() # Get the broker and topic from a metadata update self.client._update_from_metadata(topic_metadata()) self.list_offset = list_offset() self.list_offset_error = list_offset_error() self.list_offset_request = { 1: { 'replica_id': -1, 'topics': [{ 'topic': 'topic1', 'partitions': [{ 'partition': 0, 'timestamp': Client.OFFSET_LATEST, 'max_num_offsets': 1 }, { 'partition': 1, 'timestamp': Client.OFFSET_EARLIEST, 'max_num_offsets': 1 }] }] } }
def setUp(self): # Dummy client for testing - we're not going to connect that bootstrap broker self.client = Client() self.client._connected = True # Get the broker and topic from a metadata update self.client._update_from_metadata(topic_metadata()) self.group = Group('testgroup') self.offset_fetch = offset_fetch()
def setUp(self): # Dummy client for testing - we're not going to connect that bootstrap broker self.client = Client() self.client._connected = True # Two brokers for the client broker = Broker('host1.example.com', id=1, port=8031) broker.rack = 'rack1' self.client.cluster.add_broker(broker) broker = Broker('host2.example.com', id=101, port=8032) broker.rack = 'rack1' self.client.cluster.add_broker(broker) self.metadata = topic_metadata() self.metadata_error = topic_metadata_error()
def setUp(self): # Dummy client for testing - we're not going to connect that bootstrap broker self.client = Client() # Get the broker and topic from a metadata update self.client._update_from_metadata(topic_metadata()) self.list_offset = list_offset() self.list_offset_error = list_offset_error() self.list_offset_request = {1: {'replica_id': -1, 'topics': [{'topic': 'topic1', 'partitions': [{'partition': 0, 'timestamp': Client.OFFSET_LATEST, 'max_num_offsets': 1}, {'partition': 1, 'timestamp': Client.OFFSET_EARLIEST, 'max_num_offsets': 1}]}]}}
def setUp(self): # Dummy client for testing - we're not going to connect that bootstrap broker self.client = Client() self.metadata_response = topic_metadata()
def setUp(self): self.metadata = topic_metadata()
def setUp(self): # Dummy client for testing - we're not going to connect that bootstrap broker self.client = Client(broker_list='broker1.example.com:9091,broker2.example.com:9092') self.client._connected = True self.metadata_response = topic_metadata()
def setUp(self): # Dummy client for testing - we're not going to connect that bootstrap broker self.client = Client( broker_list='broker1.example.com:9091,broker2.example.com:9092') self.client._connected = True self.metadata_response = topic_metadata()