From 2da71e2270b14555f76623fc44446d3308886a8f Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 10 Dec 2024 15:03:40 +0900 Subject: [PATCH] =?UTF-8?q?type:=20disconnect=20=E3=81=A8=20sora=20?= =?UTF-8?q?=E3=81=8B=E3=82=89=E5=88=87=E6=96=AD=E3=81=AE=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_sora_disconnect.py | 14 ++++++-------- tests/test_type_disconnect.py | 16 +++++++++++----- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/tests/test_sora_disconnect.py b/tests/test_sora_disconnect.py index 84db707..05ae7d3 100644 --- a/tests/test_sora_disconnect.py +++ b/tests/test_sora_disconnect.py @@ -41,10 +41,9 @@ def test_websocket_signaling_only_disconnect_api(setup): assert conn.ws_close_code == 1000 assert conn.ws_close_reason == "DISCONNECTED-API" - # C++ SDK 側でこのテストが通るようなコードが必要 - # assert conn.disconnect_code == SoraSignalingErrorCode.CLOSE_SUCCEEDED - # assert conn.disconnect_reason is not None - # assert "DISCONNECTED-API" in conn.disconnect_reason + assert conn.disconnect_code == SoraSignalingErrorCode.CLOSE_SUCCEEDED + assert conn.disconnect_reason is not None + assert "DISCONNECTED-API" in conn.disconnect_reason # TODO: LIFETIME-EXPIRED のテスト @@ -81,10 +80,9 @@ def test_websocket_datachannel_signaling_disconnect_api(setup): assert conn.ws_close_code == 1000 assert conn.ws_close_reason == "DISCONNECTED-API" - # C++ SDK 側でこのテストが通るようなコードが必要 - # assert conn.disconnect_code == SoraSignalingErrorCode.CLOSE_SUCCEEDED - # assert conn.disconnect_reason is not None - # assert "DISCONNECTED-API" in conn.disconnect_reason + assert conn.disconnect_code == SoraSignalingErrorCode.CLOSE_SUCCEEDED + assert conn.disconnect_reason is not None + assert "DISCONNECTED-API" in conn.disconnect_reason # TODO: LIFETIME-EXPIRED のテスト diff --git a/tests/test_type_disconnect.py b/tests/test_type_disconnect.py index 47fb920..48adabe 100644 --- a/tests/test_type_disconnect.py +++ b/tests/test_type_disconnect.py @@ -4,6 +4,8 @@ from client import SoraClient, SoraRole +from sora_sdk import SoraSignalingErrorCode + def test_websocket_signaling_only_disconnect(setup): signaling_urls = setup.get("signaling_urls") @@ -29,8 +31,10 @@ def test_websocket_signaling_only_disconnect(setup): conn.disconnect() - # error_code が 0 という意味 - assert conn.disconnect_code == 0 + assert conn.ws_close_code == 1000 + assert conn.ws_close_reason == "TYPE-DISCONNECT" + + assert conn.disconnect_code == SoraSignalingErrorCode.CLOSE_SUCCEEDED assert ( conn.disconnect_reason == "Succeeded to close WebSocket (DC signaling is not enabled)" ) @@ -62,7 +66,10 @@ def test_hybrid_signaling_disconnect(setup): conn.disconnect() - assert conn.disconnect_code == 0 + assert conn.ws_close_code == 1000 + assert conn.ws_close_reason == "TYPE-DISCONNECT" + + assert conn.disconnect_code == SoraSignalingErrorCode.CLOSE_SUCCEEDED assert conn.disconnect_reason == "Succeeded to close Websocket (DC signaling is enabled)" @@ -94,6 +101,5 @@ def test_datachannel_only_type_disconnect(setup): conn.disconnect() - # error_code が 0 という意味 - assert conn.disconnect_code == 0 + assert conn.disconnect_code == SoraSignalingErrorCode.CLOSE_SUCCEEDED assert conn.disconnect_reason == "Succeeded to close DataChannel"