

def test_recognize_chunk_reads_response_from_worker(self):
    self.id_generator.set_id([1])
    self.worker.connect_to_worker('en-GB')
    received_response = list(self.worker.recognize_chunk(b'some binary chunk encoded in base64', frame_rate=44100))
    expected_response = [{
        'status': 0,
        'result': {
            'hypotheses': [{
                'transcript': 'Hello World!',
                'confidence': 1.0,
            }],
        },
        'final': True,
        'chunk_id': '0',
        'request_id': '1',
    }]
    self.assertEquals(expected_response, received_response)

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