refactor to a single peer, refuse via 409 on handshake (#1233)

This commit is contained in:
Henry Ruhs
2026-09-11 11:49:11 +02:00
committed by GitHub
parent cdb8513d11
commit 40c554b59d
8 changed files with 80 additions and 75 deletions
+19 -2
View File
@@ -156,7 +156,16 @@ def test_delete_stream_video(test_client : TestClient) -> None:
'Content-Type': 'application/sdp'
})
assert rtc_store.get_peers(session_id)
assert rtc_store.has_peer(session_id) is True
post_response = test_client.post('/stream', content = sdp_offer, headers =
{
'Authorization': 'Bearer ' + access_token,
'Content-Type': 'application/sdp'
})
assert post_response.status_code == 409
assert rtc_store.has_peer(session_id) is True
delete_response = test_client.delete('/stream', headers =
{
@@ -164,4 +173,12 @@ def test_delete_stream_video(test_client : TestClient) -> None:
})
assert delete_response.status_code == 200
assert rtc_store.get_peers(session_id) is None
assert rtc_store.has_peer(session_id) is False
post_response = test_client.post('/stream', content = 'invalid', headers =
{
'Authorization': 'Bearer ' + access_token,
'Content-Type': 'application/sdp'
})
assert post_response.status_code == 404