Skip to content

Commit ccbdbb5

Browse files
committed
Fix errors in python 3.3
1 parent 7778e82 commit ccbdbb5

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tests/test_session_creation.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def test_create_default_session(self):
2424

2525
expect(httpretty.last_request().headers[u('x-tb-partner-auth')]).to.equal(self.api_key+u(':')+self.api_secret)
2626
expect(httpretty.last_request().headers[u('user-agent')]).to.contain(u('OpenTok-Python-SDK/')+__version__)
27-
expect(httpretty.last_request().body).to.equal(b('archiveMode=manual&p2p.preference=enabled'))
27+
body = parse_qs(httpretty.last_request().body)
28+
expect(body).to.have.key(b('p2p.preference')).being.equal([b('enabled')])
29+
expect(body).to.have.key(b('archiveMode')).being.equal([b('manual')])
2830
expect(session).to.be.a(Session)
2931
expect(session).to.have.property(u('session_id')).being.equal(u('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg'))
3032
expect(session).to.have.property(u('media_mode')).being.equal(MediaModes.relayed)
@@ -41,7 +43,9 @@ def test_create_routed_session(self):
4143

4244
expect(httpretty.last_request().headers[u('x-tb-partner-auth')]).to.equal(self.api_key+u(':')+self.api_secret)
4345
expect(httpretty.last_request().headers[u('user-agent')]).to.contain(u('OpenTok-Python-SDK/')+__version__)
44-
expect(httpretty.last_request().body).to.equal(b('archiveMode=manual&p2p.preference=disabled'))
46+
body = parse_qs(httpretty.last_request().body)
47+
expect(body).to.have.key(b('p2p.preference')).being.equal([b('disabled')])
48+
expect(body).to.have.key(b('archiveMode')).being.equal([b('manual')])
4549
expect(session).to.be.a(Session)
4650
expect(session).to.have.property(u('session_id')).being.equal(u('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg'))
4751
expect(session).to.have.property(u('media_mode')).being.equal(MediaModes.routed)
@@ -98,7 +102,9 @@ def test_create_manual_archive_mode_session(self):
98102

99103
expect(httpretty.last_request().headers[u('x-tb-partner-auth')]).to.equal(self.api_key+u(':')+self.api_secret)
100104
expect(httpretty.last_request().headers[u('user-agent')]).to.contain(u('OpenTok-Python-SDK/')+__version__)
101-
expect(httpretty.last_request().body).to.equal(b('archiveMode=manual&p2p.preference=disabled'))
105+
body = parse_qs(httpretty.last_request().body)
106+
expect(body).to.have.key(b('p2p.preference')).being.equal([b('disabled')])
107+
expect(body).to.have.key(b('archiveMode')).being.equal([b('manual')])
102108
expect(session).to.be.a(Session)
103109
expect(session).to.have.property(u('session_id')).being.equal(u('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg'))
104110
expect(session).to.have.property(u('media_mode')).being.equal(MediaModes.routed)
@@ -115,7 +121,9 @@ def test_create_always_archive_mode_session(self):
115121

116122
expect(httpretty.last_request().headers[u('x-tb-partner-auth')]).to.equal(self.api_key+u(':')+self.api_secret)
117123
expect(httpretty.last_request().headers[u('user-agent')]).to.contain(u('OpenTok-Python-SDK/')+__version__)
118-
expect(httpretty.last_request().body).to.equal(b('archiveMode=always&p2p.preference=disabled'))
124+
body = parse_qs(httpretty.last_request().body)
125+
expect(body).to.have.key(b('p2p.preference')).being.equal([b('disabled')])
126+
expect(body).to.have.key(b('archiveMode')).being.equal([b('always')])
119127
expect(session).to.be.a(Session)
120128
expect(session).to.have.property(u('session_id')).being.equal(u('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg'))
121129
expect(session).to.have.property(u('media_mode')).being.equal(MediaModes.routed)

0 commit comments

Comments
 (0)