Skip to content

Commit d5d0508

Browse files
committed
Added paused status
1 parent bf19f14 commit d5d0508

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

opentok/archives.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class Archive(object):
6969
* "available" -- The archive is available for download from the OpenTok cloud.
7070
* "expired" -- The archive is no longer available for download from the OpenTok cloud.
7171
* "failed" -- The archive recording failed.
72+
* "paused" -- The archive recording has paused.
7273
* "started" -- The archive started and is in the process of being recorded.
7374
* "stopped" -- The archive stopped recording.
7475
* "uploaded" -- The archive is available for download from the the upload target

tests/test_archive_api.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,33 @@ def test_find_archives_with_offset_and_count(self):
666666
expect(list(archive_list.items)).to.have.length_of(4)
667667
# TODO: we could inspect each item in the list
668668

669+
@httpretty.activate
670+
def test_find_paused_archive(self):
671+
archive_id = u('f6e7ee58-d6cf-4a59-896b-6d56b158ec71')
672+
httpretty.register_uri(httpretty.GET, u('https://api.opentok.com/v2/partner/{0}/archive/{1}').format(self.api_key, archive_id),
673+
body=textwrap.dedent(u("""\
674+
{
675+
"createdAt" : 1395187836000,
676+
"duration" : 62,
677+
"id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71",
678+
"name" : "",
679+
"partnerId" : 123456,
680+
"reason" : "",
681+
"sessionId" : "SESSIONID",
682+
"size" : 8347554,
683+
"status" : "paused",
684+
"hasAudio": true,
685+
"hasVideo": true,
686+
"url" : null
687+
}""")),
688+
status=200,
689+
content_type=u('application/json'))
690+
691+
archive = self.opentok.get_archive(archive_id)
692+
693+
expect(archive).to.be.an(Archive)
694+
expect(archive).to.have.property(u('status')).being.equal(u('paused'))
695+
669696
@httpretty.activate
670697
def test_find_expired_archive(self):
671698
archive_id = u('f6e7ee58-d6cf-4a59-896b-6d56b158ec71')

0 commit comments

Comments
 (0)