def setUp(self): master_response = createMasterResponseMessage( "SUCCESS", self.background_worker_socket) worker_response = createResultsMessage(True, [(1.0, "Hello World!")]) self.master_socket = SocketSpy() self.master_socket.set_messages([master_response.SerializeToString()] * 2) self.worker_socket = SocketSpy() self.worker_socket.set_messages([worker_response.SerializeToString()] * 2) self.decoder = DummyDecoder() self.id_generator = DummyIDGenerator() self.worker = FrontendWorker(self.master_socket, self.worker_socket, self.decoder, self.id_generator)
def setUp(self): self.id = 0 self.final_hypothesis = [(1.0, "Hello World!")] self.model = "en-GB" self.chunk = b"chunk" self.frame_rate = 44100 self.socket = SocketSpy() self.saver = RemoteSaver(self.socket, self.model)
def setUp(self): self.model = "en-GB" self.worker_address = "tcp://127.0.0.1:5678" self.master_socket = SocketSpy() self.saver = SaverSpy() self.heartbeat = Heartbeat(self.model, self.worker_address, self.master_socket) self.poller = PollerSpy() self.asr = ASRSpy([(1.0, "Hello World!")], (1.0, "Interim result")) self.audio = DummyAudio() self.worker = Worker(self.poller, self.heartbeat, self.asr, self.audio, self.saver, self.poller.has_next_message)
def setUp(self): self.model = RecordingsModelSpy() self.socket = SocketSpy() self.create_socket = lambda: self.socket self.saver = RecordingsSaver(self.create_socket, self.model, self.socket.has_next_message)
def setUp(self): self.poller = PollerSpy() self.monitor_socket = SocketSpy() self.master = Master(self.poller, self.monitor_socket, self.poller.has_next_message)