def test_delete_archive(self): archive_id = u('ARCHIVEID') archive = Archive( self.opentok, { u('createdAt'): 1395183243556, u('duration'): 0, u('id'): archive_id, u('name'): u(''), u('partnerId'): 123456, u('reason'): u(''), u('sessionId'): u('SESSIONID'), u('size'): 0, u('status'): u('available'), u('hasAudio'): True, u('hasVideo'): True, u('outputMode'): OutputModes.composed.value, u('url'): None, }) httpretty.register_uri( httpretty.DELETE, u('https://api.opentok.com/v2/partner/{0}/archive/{1}').format( self.api_key, archive_id), body=u(''), status=204) archive.delete() expect(httpretty.last_request().headers[u( 'x-tb-partner-auth')]).to.equal(self.api_key + u(':') + self.api_secret) expect(httpretty.last_request().headers[u('user-agent')]).to.contain( u('OpenTok-Python-SDK/') + __version__) expect(httpretty.last_request().headers[u('content-type')]).to.equal( u('application/json'))
def test_delete_archive_1(self): self.httpretty_enable() archive_id = u('ARCHIVEID') archive = Archive(self.opentok, { u('createdAt'): 1395183243556, u('duration'): 0, u('id'): archive_id, u('name'): u(''), u('partnerId'): 123456, u('reason'): u(''), u('sessionId'): u('SESSIONID'), u('size'): 0, u('status'): u('available'), u('url'): None, }) httpretty.register_uri(httpretty.DELETE, u('https://api.opentok.com/v2/partner/{0}/archive/{1}').format(self.api_key, archive_id), body=u(''), status=204) archive.delete() expect(httpretty.last_request().headers[u('x-tb-partner-auth')]).to.equal(self.api_key+u(':')+self.api_secret) expect(httpretty.last_request().headers[u('user-agent')]).to.contain(u('OpenTok-Python-SDK/')+__version__) expect(httpretty.last_request().headers[u('content-type')]).to.equal(u('application/json')) self.httpretty_disable()
def test_delete_archive(self): archive_id = u('ARCHIVEID') archive = Archive(self.opentok, { u('createdAt'): 1395183243556, u('duration'): 0, u('id'): archive_id, u('name'): u(''), u('partnerId'): 123456, u('reason'): u(''), u('sessionId'): u('SESSIONID'), u('size'): 0, u('status'): u('available'), u('hasAudio'): True, u('hasVideo'): True, u('outputMode'): OutputModes.composed.value, u('url'): None, }) httpretty.register_uri(httpretty.DELETE, u('https://api.opentok.com/v2/partner/{0}/archive/{1}').format(self.api_key, archive_id), body=u(''), status=204) archive.delete() validate_jwt_header(self, httpretty.last_request().headers[u('x-opentok-auth')]) expect(httpretty.last_request().headers[u('user-agent')]).to(contain(u('OpenTok-Python-SDK/')+__version__)) expect(httpretty.last_request().headers[u('content-type')]).to(equal(u('application/json')))
def test_delete_archive(self): archive_id = u("ARCHIVEID") archive = Archive( self.opentok, { u("createdAt"): 1395183243556, u("duration"): 0, u("id"): archive_id, u("name"): u(""), u("partnerId"): 123456, u("reason"): u(""), u("sessionId"): u("SESSIONID"), u("size"): 0, u("status"): u("available"), u("hasAudio"): True, u("hasVideo"): True, u("outputMode"): OutputModes.composed.value, u("url"): None, }, ) httpretty.register_uri( httpretty.DELETE, u("https://api.opentok.com/v2/project/{0}/archive/{1}").format( self.api_key, archive_id ), body=u(""), status=204, ) archive.delete() validate_jwt_header(self, httpretty.last_request().headers[u("x-opentok-auth")]) expect(httpretty.last_request().headers[u("user-agent")]).to( contain(u("OpenTok-Python-SDK/") + __version__) ) expect(httpretty.last_request().headers[u("content-type")]).to( equal(u("application/json")) )