@@ -460,3 +460,53 @@ def test_find_archives_with_offset_and_count(self):
460
460
expect (archive_list ).to .have .property (u ('count' )).being .equal (6 )
461
461
expect (list (archive_list .items )).to .have .length_of (4 )
462
462
# TODO: we could inspect each item in the list
463
+
464
+ @httpretty .activate
465
+ def test_find_expired_archive (self ):
466
+ archive_id = u ('f6e7ee58-d6cf-4a59-896b-6d56b158ec71' )
467
+ httpretty .register_uri (httpretty .GET , u ('https://api.opentok.com/v2/partner/{0}/archive/{1}' ).format (self .api_key , archive_id ),
468
+ body = textwrap .dedent (u ("""\
469
+ {
470
+ "createdAt" : 1395187836000,
471
+ "duration" : 62,
472
+ "id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71",
473
+ "name" : "",
474
+ "partnerId" : 123456,
475
+ "reason" : "",
476
+ "sessionId" : "SESSIONID",
477
+ "size" : 8347554,
478
+ "status" : "expired",
479
+ "url" : null
480
+ }""" )),
481
+ status = 200 ,
482
+ content_type = u ('application/json' ))
483
+
484
+ archive = self .opentok .get_archive (archive_id )
485
+
486
+ expect (archive ).to .be .an (Archive )
487
+ expect (archive ).to .have .property (u ('status' )).being .equal (u ('expired' ))
488
+
489
+ @httpretty .activate
490
+ def test_find_archive_with_unknown_properties (self ):
491
+ archive_id = u ('f6e7ee58-d6cf-4a59-896b-6d56b158ec71' )
492
+ httpretty .register_uri (httpretty .GET , u ('https://api.opentok.com/v2/partner/{0}/archive/{1}' ).format (self .api_key , archive_id ),
493
+ body = textwrap .dedent (u ("""\
494
+ {
495
+ "createdAt" : 1395187836000,
496
+ "duration" : 62,
497
+ "id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71",
498
+ "name" : "",
499
+ "partnerId" : 123456,
500
+ "reason" : "",
501
+ "sessionId" : "SESSIONID",
502
+ "size" : 8347554,
503
+ "status" : "expired",
504
+ "url" : null,
505
+ "notarealproperty" : "not a real value"
506
+ }""" )),
507
+ status = 200 ,
508
+ content_type = u ('application/json' ))
509
+
510
+ archive = self .opentok .get_archive (archive_id )
511
+
512
+ expect (archive ).to .be .an (Archive )
0 commit comments