@@ -24,27 +24,27 @@ 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 ('p2p.preference=disabled ' ))
27+ expect (httpretty .last_request ().body ).to .equal (b ('p2p.preference=enabled ' ))
2828 expect (session ).to .be .a (Session )
2929 expect (session ).to .have .property (u ('session_id' )).being .equal (u ('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg' ))
30- expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .routed )
30+ expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .relayed )
3131 expect (session ).to .have .property (u ('location' )).being .equal (None )
3232
3333 @httpretty .activate
34- def test_create_p2p_session (self ):
34+ def test_create_routed_session (self ):
3535 httpretty .register_uri (httpretty .POST , u ('https://api.opentok.com/session/create' ),
3636 body = u ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><sessions><Session><session_id>1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg</session_id><partner_id>123456</partner_id><create_dt>Mon Mar 17 00:41:31 PDT 2014</create_dt></Session></sessions>' ),
3737 status = 200 ,
3838 content_type = u ('text/xml' ))
3939
40- session = self .opentok .create_session (media_mode = MediaModes .relayed )
40+ session = self .opentok .create_session (media_mode = MediaModes .routed )
4141
4242 expect (httpretty .last_request ().headers [u ('x-tb-partner-auth' )]).to .equal (self .api_key + u (':' )+ self .api_secret )
4343 expect (httpretty .last_request ().headers [u ('user-agent' )]).to .contain (u ('OpenTok-Python-SDK/' )+ __version__ )
44- expect (httpretty .last_request ().body ).to .equal (b ('p2p.preference=enabled ' ))
44+ expect (httpretty .last_request ().body ).to .equal (b ('p2p.preference=disabled ' ))
4545 expect (session ).to .be .a (Session )
4646 expect (session ).to .have .property (u ('session_id' )).being .equal (u ('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg' ))
47- expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .relayed )
47+ expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .routed )
4848 expect (session ).to .have .property (u ('location' )).being .equal (None )
4949
5050 @httpretty .activate
@@ -61,30 +61,30 @@ def test_create_session_with_location_hint(self):
6161 # ordering of keys is non-deterministic, must parse the body to see if it is correct
6262 body = parse_qs (httpretty .last_request ().body )
6363 expect (body ).to .have .key (b ('location' )).being .equal ([b ('12.34.56.78' )])
64- expect (body ).to .have .key (b ('p2p.preference' )).being .equal ([b ('disabled ' )])
64+ expect (body ).to .have .key (b ('p2p.preference' )).being .equal ([b ('enabled ' )])
6565 expect (session ).to .be .a (Session )
6666 expect (session ).to .have .property (u ('session_id' )).being .equal (u ('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg' ))
67- expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .routed )
67+ expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .relayed )
6868 expect (session ).to .have .property (u ('location' )).being .equal (u ('12.34.56.78' ))
6969
7070 @httpretty .activate
71- def test_create_p2p_session_with_location_hint (self ):
71+ def test_create_routed_session_with_location_hint (self ):
7272 httpretty .register_uri (httpretty .POST , u ('https://api.opentok.com/session/create' ),
7373 body = u ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><sessions><Session><session_id>1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg</session_id><partner_id>123456</partner_id><create_dt>Mon Mar 17 00:41:31 PDT 2014</create_dt></Session></sessions>' ),
7474 status = 200 ,
7575 content_type = u ('text/xml' ))
7676
77- session = self .opentok .create_session (location = '12.34.56.78' , media_mode = MediaModes .relayed )
77+ session = self .opentok .create_session (location = '12.34.56.78' , media_mode = MediaModes .routed )
7878
7979 expect (httpretty .last_request ().headers [u ('x-tb-partner-auth' )]).to .equal (self .api_key + u (':' )+ self .api_secret )
8080 expect (httpretty .last_request ().headers [u ('user-agent' )]).to .contain (u ('OpenTok-Python-SDK/' )+ __version__ )
8181 # ordering of keys is non-deterministic, must parse the body to see if it is correct
8282 body = parse_qs (httpretty .last_request ().body )
8383 expect (body ).to .have .key (b ('location' )).being .equal ([b ('12.34.56.78' )])
84- expect (body ).to .have .key (b ('p2p.preference' )).being .equal ([b ('enabled ' )])
84+ expect (body ).to .have .key (b ('p2p.preference' )).being .equal ([b ('disabled ' )])
8585 expect (session ).to .be .a (Session )
8686 expect (session ).to .have .property (u ('session_id' )).being .equal (u ('1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg' ))
87- expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .relayed )
87+ expect (session ).to .have .property (u ('media_mode' )).being .equal (MediaModes .routed )
8888 expect (session ).to .have .property (u ('location' )).being .equal (u ('12.34.56.78' ))
8989
9090 # TODO: all the cases that throw exceptions
0 commit comments