6
6
7
7
from six import u , PY2 , PY3
8
8
from expects import *
9
- from opentok import Client , WebhookAudioConnection , __version__
9
+ from opentok import Client , WebsocketAudioConnection , __version__
10
10
from opentok .exceptions import InvalidWebsocketOptionsError , InvalidMediaModeError
11
11
from .validate_jwt import validate_jwt_header
12
12
@@ -43,7 +43,7 @@ def test_stream_audio_to_websocket(self):
43
43
"uri" : "wss://service.com/ws-endpoint"
44
44
}
45
45
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 )
47
47
48
48
validate_jwt_header (self , httpretty .last_request ().headers [u ("x-opentok-auth" )])
49
49
expect (httpretty .last_request ().headers [u ("user-agent" )]).to (
@@ -60,11 +60,11 @@ def test_stream_audio_to_websocket(self):
60
60
body = json .loads (httpretty .last_request ().body .decode ("utf-8" ))
61
61
62
62
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 (
65
65
have_property (u ("id" ), u ("b0a5a8c7-dc38-459f-a48d-a7f2008da853" ))
66
66
)
67
- expect (webhook_audio_connection ).to (
67
+ expect (websocket_audio_connection ).to (
68
68
have_property (u ("connectionId" ), u ("e9f8c166-6c67-440d-994a-04fb6dfed007" ))
69
69
)
70
70
@@ -86,7 +86,7 @@ def test_stream_audio_to_websocket_custom_options(self):
86
86
}
87
87
}
88
88
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 )
90
90
91
91
validate_jwt_header (self , httpretty .last_request ().headers [u ("x-opentok-auth" )])
92
92
expect (httpretty .last_request ().headers [u ("user-agent" )]).to (
@@ -103,11 +103,11 @@ def test_stream_audio_to_websocket_custom_options(self):
103
103
body = json .loads (httpretty .last_request ().body .decode ("utf-8" ))
104
104
105
105
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 (
108
108
have_property (u ("id" ), u ("b0a5a8c7-dc38-459f-a48d-a7f2008da853" ))
109
109
)
110
- expect (webhook_audio_connection ).to (
110
+ expect (websocket_audio_connection ).to (
111
111
have_property (u ("connectionId" ), u ("e9f8c166-6c67-440d-994a-04fb6dfed007" ))
112
112
)
113
113
@@ -149,4 +149,4 @@ def test_stream_audio_to_websocket_missing_uri_error(self):
149
149
websocket_options = {}
150
150
with self .assertRaises (InvalidWebsocketOptionsError ) as context :
151
151
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