예제 #1
0
 def test_stuns(self):
     uri = parse_stun_turn_uri("stuns:stun.services.mozilla.com")
     self.assertEqual(uri, {
         "host": "stun.services.mozilla.com",
         "port": 5349,
         "scheme": "stuns"
     })
예제 #2
0
 def test_stun_with_port(self):
     uri = parse_stun_turn_uri("stun:stun.l.google.com:19302")
     self.assertEqual(uri, {
         "host": "stun.l.google.com",
         "port": 19302,
         "scheme": "stun"
     })
예제 #3
0
 def test_stun_with_port(self):
     uri = parse_stun_turn_uri('stun:stun.l.google.com:19302')
     self.assertEqual(uri, {
         'host': 'stun.l.google.com',
         'port': 19302,
         'scheme': 'stun',
     })
예제 #4
0
 def test_stuns(self):
     uri = parse_stun_turn_uri('stuns:stun.services.mozilla.com')
     self.assertEqual(uri, {
         'host': 'stun.services.mozilla.com',
         'port': 5349,
         'scheme': 'stuns',
     })
예제 #5
0
 def test_turn_with_port_and_transport(self):
     uri = parse_stun_turn_uri("turn:1.2.3.4:3478?transport=tcp")
     self.assertEqual(uri, {
         "host": "1.2.3.4",
         "port": 3478,
         "scheme": "turn",
         "transport": "tcp"
     })
예제 #6
0
 def test_turn(self):
     uri = parse_stun_turn_uri("turn:1.2.3.4")
     self.assertEqual(uri, {
         "host": "1.2.3.4",
         "port": 3478,
         "scheme": "turn",
         "transport": "udp"
     })
예제 #7
0
 def test_turns_with_port_and_transport(self):
     uri = parse_stun_turn_uri('turns:1.2.3.4:1234?transport=tcp')
     self.assertEqual(uri, {
         'host': '1.2.3.4',
         'port': 1234,
         'scheme': 'turns',
         'transport': 'tcp',
     })
예제 #8
0
 def test_turns(self):
     uri = parse_stun_turn_uri('turns:1.2.3.4')
     self.assertEqual(uri, {
         'host': '1.2.3.4',
         'port': 5349,
         'scheme': 'turns',
         'transport': 'tcp',
     })
예제 #9
0
 def test_turn(self):
     uri = parse_stun_turn_uri('turn:1.2.3.4')
     self.assertEqual(uri, {
         'host': '1.2.3.4',
         'port': 3478,
         'scheme': 'turn',
         'transport': 'udp',
     })
예제 #10
0
 def test_turns_with_port_and_transport(self):
     uri = parse_stun_turn_uri("turns:1.2.3.4:1234?transport=tcp")
     self.assertEqual(
         uri,
         {
             "host": "1.2.3.4",
             "port": 1234,
             "scheme": "turns",
             "transport": "tcp"
         },
     )
예제 #11
0
 def test_turns(self):
     uri = parse_stun_turn_uri("turns:1.2.3.4")
     self.assertEqual(
         uri,
         {
             "host": "1.2.3.4",
             "port": 5349,
             "scheme": "turns",
             "transport": "tcp"
         },
     )
예제 #12
0
 def test_invalid_uri(self):
     with self.assertRaises(ValueError) as cm:
         parse_stun_turn_uri("stun")
     self.assertEqual(str(cm.exception), "malformed uri")
예제 #13
0
 def test_invalid_scheme(self):
     with self.assertRaises(ValueError) as cm:
         parse_stun_turn_uri('foo')
     self.assertEqual(str(cm.exception), 'malformed uri: invalid scheme')