コード例 #1
0
    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
                    }]
                }]
            }
        }
コード例 #2
0
    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()
コード例 #3
0
    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()
コード例 #4
0
ファイル: test_offsets.py プロジェクト: ambroff/kafka-tools
    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}]}]}}
コード例 #5
0
 def setUp(self):
     # Dummy client for testing - we're not going to connect that bootstrap broker
     self.client = Client()
     self.metadata_response = topic_metadata()
コード例 #6
0
 def setUp(self):
     self.metadata = topic_metadata()
コード例 #7
0
ファイル: test_interface.py プロジェクト: ambroff/kafka-tools
 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()
コード例 #8
0
 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()