Пример #1
0
 def test_create_url09(self):
     self.assertEqual(
         createWsUrl("localhost",
                     isSecure=True,
                     port=9090,
                     path="ws",
                     params={'foo': 'bar'}),
         "wss://localhost:9090/ws?foo=bar")
Пример #2
0
 def test_create_url10(self):
     wsurl = createWsUrl("localhost",
                         isSecure=True,
                         port=9090,
                         path="ws",
                         params={
                             'foo': 'bar',
                             'moo': 23
                         })
     self.assertTrue(wsurl == "wss://localhost:9090/ws?foo=bar&moo=23"
                     or wsurl == "wss://localhost:9090/ws?moo=23&foo=bar")
Пример #3
0
def main(listen_addr='127.0.0.1',
         port=8947,
         gpsdws_www_root=DEFAULT_GPSDWS_ROOT,
         cert=DEFAULT_CERT):
    # Load server certificate
    certData = open(DEFAULT_CERT, 'rb').read()
    certificate = ssl.PrivateCertificate.loadPEM(certData)

    # Create server
    uri = createWsUrl(listen_addr, port)
    site = GPSdWSSite(uri, gpsdws_www_root)
    reactor.listenSSL(port, site, certificate.options(), interface=listen_addr)
Пример #4
0
 def test_create_url05(self):
     self.assertEqual(createWsUrl("localhost", path="/ws/foobar"),
                      "ws://localhost:80/ws/foobar")
Пример #5
0
 def test_create_url02(self):
     self.assertEqual(createWsUrl("localhost", port=8090),
                      "ws://localhost:8090/")
Пример #6
0
 def test_create_url03(self):
     self.assertEqual(createWsUrl("localhost", path="ws"),
                      "ws://localhost:80/ws")
Пример #7
0
 def test_create_url15(self):
     self.assertEqual(createWsUrl("0:0:0:0:0:0:0:1", path="ws"),
                      "ws://0:0:0:0:0:0:0:1:80/ws")
Пример #8
0
 def test_create_url01(self):
     self.assertEqual(createWsUrl("localhost"), "ws://localhost:80/")
Пример #9
0
 def test_create_url02(self):
    self.assertEqual(createWsUrl("localhost", port = 8090), "ws://localhost:8090/")
Пример #10
0
 def test_create_url05(self):
    self.assertEqual(createWsUrl("localhost", path = "/ws/foobar"), "ws://localhost:80/ws/foobar")
Пример #11
0
 def test_create_url12(self):
    self.assertEqual(createWsUrl("62.146.25.34", path = "ws"), "ws://62.146.25.34:80/ws")
Пример #12
0
 def test_create_url11(self):
     self.assertEqual(createWsUrl("127.0.0.1", path="ws"),
                      "ws://127.0.0.1:80/ws")
Пример #13
0
 def test_create_url10(self):
    wsurl = createWsUrl("localhost", isSecure = True, port = 9090, path = "ws", params = {'foo': 'bar', 'moo': 23})
    self.assertTrue(wsurl == "wss://localhost:9090/ws?foo=bar&moo=23" or wsurl == "wss://localhost:9090/ws?moo=23&foo=bar")
Пример #14
0
 def test_create_url11(self):
    self.assertEqual(createWsUrl("127.0.0.1", path = "ws"), "ws://127.0.0.1:80/ws")
Пример #15
0
 def test_create_url09(self):
    self.assertEqual(createWsUrl("localhost", isSecure = True, port = 9090, path = "ws", params = {'foo': 'bar'}), "wss://localhost:9090/ws?foo=bar")
Пример #16
0
 def test_create_url08(self):
    self.assertEqual(createWsUrl("localhost", isSecure = True, port = 80), "wss://localhost:80/")
Пример #17
0
 def test_create_url07(self):
    self.assertEqual(createWsUrl("localhost", isSecure = True, port = 443), "wss://localhost:443/")
Пример #18
0
 def test_create_url07(self):
     self.assertEqual(createWsUrl("localhost", isSecure=True, port=443),
                      "wss://localhost:443/")
Пример #19
0
 def test_create_url13(self):
     self.assertEqual(createWsUrl("subsub1.sub1.something.com", path="ws"),
                      "ws://subsub1.sub1.something.com:80/ws")
Пример #20
0
 def test_create_url08(self):
     self.assertEqual(createWsUrl("localhost", isSecure=True, port=80),
                      "wss://localhost:80/")
Пример #21
0
 def test_create_url01(self):
    self.assertEqual(createWsUrl("localhost"), "ws://localhost:80/")
Пример #22
0
 def test_create_url13(self):
    self.assertEqual(createWsUrl("subsub1.sub1.something.com", path = "ws"), "ws://subsub1.sub1.something.com:80/ws")
Пример #23
0
 def test_create_url03(self):
    self.assertEqual(createWsUrl("localhost", path = "ws"), "ws://localhost:80/ws")
Пример #24
0
 def test_create_url12(self):
     self.assertEqual(createWsUrl("62.146.25.34", path="ws"),
                      "ws://62.146.25.34:80/ws")
Пример #25
0
 def test_create_url14(self):
    self.assertEqual(createWsUrl("::1", path = "ws"), "ws://::1:80/ws")
Пример #26
0
 def test_create_url14(self):
     self.assertEqual(createWsUrl("::1", path="ws"), "ws://::1:80/ws")
Пример #27
0
 def test_create_url15(self):
    self.assertEqual(createWsUrl("0:0:0:0:0:0:0:1", path = "ws"), "ws://0:0:0:0:0:0:0:1:80/ws")