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"