mirror of
https://github.com/suitenumerique/meet.git
synced 2026-09-03 14:17:59 +00:00
♻️(backend) fix Twirp error mocking in tests
Tests were incorrectly mocking Twirp errors using HTTP status codes instead of the meaningful error codes returned by the LiveKit SDK. Update mocks to reflect actual SDK behavior.
This commit is contained in:
@@ -91,7 +91,7 @@ def test_mute_participant_unexpected_twirp_error(mock_livekit_client):
|
||||
client = APIClient()
|
||||
|
||||
mock_livekit_client.room.mute_published_track.side_effect = TwirpError(
|
||||
msg="Internal server error", code=500, status=500
|
||||
msg="Internal server error", code="unknown", status=500
|
||||
)
|
||||
|
||||
room = RoomFactory()
|
||||
@@ -387,7 +387,7 @@ def test_update_participant_unexpected_twirp_error(mock_livekit_client):
|
||||
client = APIClient()
|
||||
|
||||
mock_livekit_client.room.update_participant.side_effect = TwirpError(
|
||||
msg="Internal server error", code=500, status=500
|
||||
msg="Internal server error", code="unknown", status=500
|
||||
)
|
||||
|
||||
room = RoomFactory()
|
||||
@@ -526,7 +526,7 @@ def test_remove_participant_unexpected_twirp_error(mock_livekit_client):
|
||||
client = APIClient()
|
||||
|
||||
mock_livekit_client.room.remove_participant.side_effect = TwirpError(
|
||||
msg="Internal server error", code=500, status=500
|
||||
msg="Internal server error", code="unknown", status=500
|
||||
)
|
||||
|
||||
room = RoomFactory()
|
||||
|
||||
@@ -172,7 +172,7 @@ def test_start_subtitle_twirp_error(
|
||||
client = APIClient()
|
||||
|
||||
mock_livekit_client.agent_dispatch.create_dispatch.side_effect = TwirpError(
|
||||
msg="Internal server error", code=500, status=500
|
||||
msg="Internal server error", code="unknown", status=500
|
||||
)
|
||||
|
||||
response = client.post(
|
||||
|
||||
Reference in New Issue
Block a user