server: fixes tests

This commit is contained in:
2023-08-31 12:05:19 +02:00
committed by Mathieu Virbel
parent 600f2ca370
commit a7f0cdd50e

View File

@@ -24,15 +24,12 @@ async def test_basic_process(event_loop):
LLM.register("test", LLMTest) LLM.register("test", LLMTest)
# event callback # event callback
marks = { marks = {}
"transcript": 0,
"topic": 0,
"summary": 0,
}
async def event_callback(event, data): async def event_callback(event):
print(f"{event}: {data}") if event.processor not in marks:
marks[event] += 1 marks[event.processor] = 0
marks[event.processor] += 1
# invoke the process and capture events # invoke the process and capture events
path = Path(__file__).parent / "records" / "test_mathieu_hello.wav" path = Path(__file__).parent / "records" / "test_mathieu_hello.wav"
@@ -40,6 +37,6 @@ async def test_basic_process(event_loop):
print(marks) print(marks)
# validate the events # validate the events
assert marks["transcript"] == 5 assert marks["TranscriptLinerProcessor"] == 5
assert marks["topic"] == 1 assert marks["TranscriptTopicDetectorProcessor"] == 1
assert marks["summary"] == 1 assert marks["TranscriptFinalSummaryProcessor"] == 1