-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
56 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/test/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
numpy | ||
python-socketio==5.0.4 | ||
websocket-client==1.7.0 | ||
requests |
37 changes: 0 additions & 37 deletions
37
...rtc-native-client/OpenteraWebrtcNativeClient/python/test/socketio_inactive_client_test.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...tc-native-client/OpenteraWebrtcNativeClient/python/test/websocket_inactive_client_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import threading | ||
|
||
import websocket | ||
|
||
from callback_awaiter import CallbackAwaiter | ||
from failure_test_case import FailureTestCase | ||
from signaling_server_runner import SignalingServerRunner | ||
|
||
|
||
class WebSocketInactiveClientTestCase(FailureTestCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
super(WebSocketInactiveClientTestCase, cls).setUpClass() | ||
cls._signaling_server_runner = SignalingServerRunner() | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
cls._signaling_server_runner.close() | ||
super(WebSocketInactiveClientTestCase, cls).tearDownClass() | ||
|
||
def test_socketio_inactive_is_disconnected_after_timeout(self): | ||
awaiter = CallbackAwaiter(2, 15) | ||
|
||
def on_open(ws): | ||
awaiter.done() | ||
|
||
def on_message(ws, message): | ||
pass | ||
|
||
def on_error(ws, error): | ||
awaiter.done() | ||
awaiter.done() | ||
self.add_failure(error) | ||
|
||
def on_close(ws, close_status_code, close_msg): | ||
awaiter.done() | ||
|
||
websocket.enableTrace(True) | ||
ws = websocket.WebSocketApp('ws://localhost:8080/signaling', | ||
on_open=on_open, on_message=on_message, on_error=on_error, on_close=on_close) | ||
|
||
thread = threading.Thread(target=ws.run_forever) | ||
thread.start() | ||
|
||
awaiter.wait() | ||
ws.close() |