@@ -24,7 +24,9 @@ def test_create_default_session(self):
24
24
25
25
expect (httpretty .last_request ().headers [u ('x-tb-partner-auth' )]).to .equal (self .api_key + u (':' )+ self .api_secret )
26
26
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' )])
28
30
expect (session ).to .be .a (Session )
29
31
expect (session ).to .have .property (u ('session_id' )).being .equal (u ('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg' ))
30
32
expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .relayed )
@@ -41,7 +43,9 @@ def test_create_routed_session(self):
41
43
42
44
expect (httpretty .last_request ().headers [u ('x-tb-partner-auth' )]).to .equal (self .api_key + u (':' )+ self .api_secret )
43
45
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' )])
45
49
expect (session ).to .be .a (Session )
46
50
expect (session ).to .have .property (u ('session_id' )).being .equal (u ('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg' ))
47
51
expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .routed )
@@ -98,7 +102,9 @@ def test_create_manual_archive_mode_session(self):
98
102
99
103
expect (httpretty .last_request ().headers [u ('x-tb-partner-auth' )]).to .equal (self .api_key + u (':' )+ self .api_secret )
100
104
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' )])
102
108
expect (session ).to .be .a (Session )
103
109
expect (session ).to .have .property (u ('session_id' )).being .equal (u ('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg' ))
104
110
expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .routed )
@@ -115,7 +121,9 @@ def test_create_always_archive_mode_session(self):
115
121
116
122
expect (httpretty .last_request ().headers [u ('x-tb-partner-auth' )]).to .equal (self .api_key + u (':' )+ self .api_secret )
117
123
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' )])
119
127
expect (session ).to .be .a (Session )
120
128
expect (session ).to .have .property (u ('session_id' )).being .equal (u ('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg' ))
121
129
expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .routed )
0 commit comments