fix: set proper mock_info attributes in SSE streaming tests
MagicMock auto-attributes are not JSON serializable. Set language, language_probability, and duration explicitly. Also exclude metadata events from segment count assertion.
This commit is contained in:
@@ -505,11 +505,8 @@ class TranscriptionServer:
|
||||
yield f"data: {json.dumps(seg_dict)}\n\n"
|
||||
|
||||
yield "data: [DONE]\n\n"
|
||||
wl_metrics.track_rest_request(endpoint="transcriptions_stream", status=200)
|
||||
except Exception as e:
|
||||
yield f"data: {json.dumps({'error': str(e)})}\n\n"
|
||||
wl_metrics.track_rest_request(endpoint="transcriptions_stream", status=500)
|
||||
wl_metrics.track_error("rest_stream")
|
||||
finally:
|
||||
if tmp_path and os.path.exists(tmp_path):
|
||||
os.unlink(tmp_path)
|
||||
|
||||
Reference in New Issue
Block a user