def test_flush(config):
q = queue.Queue()
accumulator = RecordAccumulator(RawBuffer, config)
client = mock.Mock()
sender = Sender(queue=q, accumulator=accumulator,
client=client, partitioner=partitioner)
sender.flush()
assert not client.put_record.called
accumulator.try_append(b'-')
sender.flush()
expected_record = (b'-\n', 4)
client.put_record.assert_called_once_with(expected_record)
评论列表
文章目录