def test_normal_parse_url(self): url, host, port = devicehive.parse_url('http://example.com/api/') self.assertEquals('http://example.com/api/', url) self.assertEquals('example.com', host) self.assertEquals(80, port)
def test_default_ssl_port_parse_url(self): url, host, port = devicehive.parse_url('https://example.com/api') self.assertEquals('https://example.com/api/', url) self.assertEquals('example.com', host) self.assertEquals(443, port)
def test_redef_ssl_port_parse_url(self): url, host, port = devicehive.parse_url('https://example.com:9191/api/') self.assertEquals('https://example.com:9191/api/', url) self.assertEquals('example.com', host) self.assertEquals(9191, port)
def test_def_port_parse_url(self): url, host, port = devicehive.parse_url('http://example.com:8181/api') self.assertEquals('http://example.com:8181/api/', url) self.assertEquals('example.com', host) self.assertEquals(8181, port)