File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,7 @@ def test_task_router_grant(self):
244
244
}, decoded_token .payload ['grants' ]['task_router' ])
245
245
246
246
def test_playback_grant (self ):
247
+ """Test that PlaybackGrants are created and decoded correctly."""
247
248
grant = {
248
249
'requestCredentials' : None ,
249
250
'playbackUrl' : 'https://000.us-east-1.playback.live-video.net/api/video/v1/us-east-000.channel.000?token=xxxxx' ,
Original file line number Diff line number Diff line change @@ -200,12 +200,16 @@ def to_payload(self):
200
200
201
201
class PlaybackGrant (AccessTokenGrant ):
202
202
"""Grant to access Twilio Live stream"""
203
+
203
204
def __init__ (self , grant = None ):
205
+ """Initialize a PlaybackGrant with a grant retrieved from the Twilio API."""
204
206
self .grant = grant
205
207
206
208
@property
207
209
def key (self ):
210
+ """Return the grant's key."""
208
211
return "player"
209
212
210
213
def to_payload (self ):
214
+ """Return the grant."""
211
215
return self .grant
You can’t perform that action at this time.
0 commit comments