fix: tests for end of speech message while mocking pyaudio

This commit is contained in:
makaveli10
2024-02-16 20:31:38 +05:30
parent 78da3f6750
commit b42ced9816
4 changed files with 14 additions and 5 deletions
+1
View File
@@ -46,6 +46,7 @@ class TestClientCallbacks(BaseTestCase):
"language": self.client.language,
"task": self.client.task,
"model": self.client.model,
"use_vad": True
})
self.client.on_open(self.mock_ws_app)
self.mock_ws_app.send.assert_called_with(expected_message)
+2 -2
View File
@@ -69,7 +69,7 @@ class TestServerConnection(unittest.TestCase):
class TestServerInferenceAccuracy(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.server_process = subprocess.Popen(["python", "run_server.py"]) # Adjust the command as needed
cls.server_process = subprocess.Popen(["python", "run_server.py"])
time.sleep(2)
@classmethod
@@ -134,4 +134,4 @@ class TestExceptionHandling(unittest.TestCase):
for message in log.output:
print(message)
print()
self.assertTrue(any("Unexpected error: Unexpected error" in message for message in log.output))
self.assertTrue(any("Unexpected error" in message for message in log.output))