

def test_recognize_chunk_sends_data_with_unique_id_to_worker(self):
    self.id_generator.set_id([1, 2])
    self.worker.connect_to_worker('en-GB')
    self.worker.recognize_chunk(b'some binary chunk encoded in base64', frame_rate=44100)
    self.worker.recognize_chunk(b'some binary chunk encoded in base64', frame_rate=44100)
    expected_message = createRecognitionRequestMessage('ONLINE', b'some binary chunk decoded from base64', True, frame_rate=44100, id=1)
    self.assertThatMessagesWereSentToWorker([expected_message, expected_message])

dataset/ETHPy150Open UFAL-DSG/cloud-asr/cloudasr/api/test_lib.py TestFrontendWorker.test_recognize_chunk_sends_data_with_unique_id_to_worker/original