def test_http(self): url = "http://www.httpvshttps.com" protocol, hostname, port, path = get_url_info(url) self.assertEqual(protocol, "http") self.assertEqual(hostname, "www.httpvshttps.com") self.assertEqual(port, "80") self.assertEqual(path, "/")
def test_path(self): url = "http://statichostsharp.blob.core.windows.net/misc/rules.json" protocol, hostname, port, path = get_url_info(url) self.assertEqual(protocol, "http") self.assertEqual(hostname, "statichostsharp.blob.core.windows.net") self.assertEqual(port, "80") self.assertEqual(path, "/misc/rules.json")