@@ -44,7 +44,11 @@ def test_create_session_custom_archive_mode_and_location(client: Client):
44
44
fixture_path = "video/create_session.json" ,
45
45
)
46
46
47
- session_options = {'archive_mode' : 'always' , 'location' : '192.0.1.1' , 'media_mode' : 'routed' }
47
+ session_options = {
48
+ 'archive_mode' : 'always' ,
49
+ 'location' : '192.0.1.1' ,
50
+ 'media_mode' : 'routed' ,
51
+ }
48
52
session_info = client .video .create_session (session_options )
49
53
assert isinstance (session_info , dict )
50
54
assert session_info ['session_id' ] == session_id
@@ -130,6 +134,12 @@ def test_generate_client_token_custom_options(client: Client):
130
134
assert decoded_token ['acl' ] == ['1' , '2' , '3' ]
131
135
132
136
137
+ def test_generate_client_token_publisher_only_role (client : Client ):
138
+ token = client .video .generate_client_token (session_id , {'role' : 'publisheronly' })
139
+ decoded_token = jwt .decode (token , algorithms = 'RS256' , options = {'verify_signature' : False })
140
+ assert decoded_token ['role' ] == 'publisheronly'
141
+
142
+
133
143
def test_check_client_token_headers (client : Client ):
134
144
token = client .video .generate_client_token (session_id )
135
145
headers = jwt .get_unverified_header (token )
@@ -197,7 +207,8 @@ def test_send_signal_to_all_participants(client: Client):
197
207
)
198
208
199
209
assert isinstance (
200
- client .video .send_signal (session_id , type = 'chat' , data = 'hello from a test case' ), dict
210
+ client .video .send_signal (session_id , type = 'chat' , data = 'hello from a test case' ),
211
+ dict ,
201
212
)
202
213
assert request_content_type () == "application/json"
203
214
@@ -211,7 +222,10 @@ def test_send_signal_to_single_participant(client: Client):
211
222
212
223
assert isinstance (
213
224
client .video .send_signal (
214
- session_id , type = 'chat' , data = 'hello from a test case' , connection_id = connection_id
225
+ session_id ,
226
+ type = 'chat' ,
227
+ data = 'hello from a test case' ,
228
+ connection_id = connection_id ,
215
229
),
216
230
dict ,
217
231
)
0 commit comments