66
77from six import u , PY2 , PY3
88from expects import *
9- from opentok import Client , WebhookAudioConnection , __version__
9+ from opentok import Client , WebsocketAudioConnection , __version__
1010from opentok .exceptions import InvalidWebsocketOptionsError , InvalidMediaModeError
1111from .validate_jwt import validate_jwt_header
1212
@@ -43,7 +43,7 @@ def test_stream_audio_to_websocket(self):
4343 "uri" : "wss://service.com/ws-endpoint"
4444 }
4545
46- webhook_audio_connection = self .opentok .stream_audio_to_websocket (self .session_id , self .token , websocket_options )
46+ websocket_audio_connection = self .opentok .stream_audio_to_websocket (self .session_id , self .token , websocket_options )
4747
4848 validate_jwt_header (self , httpretty .last_request ().headers [u ("x-opentok-auth" )])
4949 expect (httpretty .last_request ().headers [u ("user-agent" )]).to (
@@ -60,11 +60,11 @@ def test_stream_audio_to_websocket(self):
6060 body = json .loads (httpretty .last_request ().body .decode ("utf-8" ))
6161
6262 expect (body ).to (have_key (u ("token" )))
63- expect (webhook_audio_connection ).to (be_a (WebhookAudioConnection ))
64- expect (webhook_audio_connection ).to (
63+ expect (websocket_audio_connection ).to (be_a (WebsocketAudioConnection ))
64+ expect (websocket_audio_connection ).to (
6565 have_property (u ("id" ), u ("b0a5a8c7-dc38-459f-a48d-a7f2008da853" ))
6666 )
67- expect (webhook_audio_connection ).to (
67+ expect (websocket_audio_connection ).to (
6868 have_property (u ("connectionId" ), u ("e9f8c166-6c67-440d-994a-04fb6dfed007" ))
6969 )
7070
@@ -86,7 +86,7 @@ def test_stream_audio_to_websocket_custom_options(self):
8686 }
8787 }
8888
89- webhook_audio_connection = self .opentok .stream_audio_to_websocket (self .session_id , self .token , websocket_options )
89+ websocket_audio_connection = self .opentok .stream_audio_to_websocket (self .session_id , self .token , websocket_options )
9090
9191 validate_jwt_header (self , httpretty .last_request ().headers [u ("x-opentok-auth" )])
9292 expect (httpretty .last_request ().headers [u ("user-agent" )]).to (
@@ -103,11 +103,11 @@ def test_stream_audio_to_websocket_custom_options(self):
103103 body = json .loads (httpretty .last_request ().body .decode ("utf-8" ))
104104
105105 expect (body ).to (have_key (u ("token" )))
106- expect (webhook_audio_connection ).to (be_a (WebhookAudioConnection ))
107- expect (webhook_audio_connection ).to (
106+ expect (websocket_audio_connection ).to (be_a (WebsocketAudioConnection ))
107+ expect (websocket_audio_connection ).to (
108108 have_property (u ("id" ), u ("b0a5a8c7-dc38-459f-a48d-a7f2008da853" ))
109109 )
110- expect (webhook_audio_connection ).to (
110+ expect (websocket_audio_connection ).to (
111111 have_property (u ("connectionId" ), u ("e9f8c166-6c67-440d-994a-04fb6dfed007" ))
112112 )
113113
@@ -149,4 +149,4 @@ def test_stream_audio_to_websocket_missing_uri_error(self):
149149 websocket_options = {}
150150 with self .assertRaises (InvalidWebsocketOptionsError ) as context :
151151 self .opentok .stream_audio_to_websocket (self .session_id , self .token , websocket_options )
152- self .assertTrue ("Provide a webhook URI." in str (context .exception ))
152+ self .assertTrue ("Provide a websocket URI." in str (context .exception ))
0 commit comments