def test_resolve(self): urls = [('http://*****:*****@localhost/blah?yeah=1#ok', 'http://*****:*****@127.0.0.1/blah?yeah=1#ok'), ('http://tarek@localhost/blah', 'http://[email protected]/blah')] for url, wanted in urls: changed, original, resolved = resolve(url) self.assertEqual(changed, wanted, '%s vs %s' % (original, resolved))
def test_resolve(self): urls = [ ("http://*****:*****@localhost/blah?yeah=1#ok", "http://*****:*****@127.0.0.1/blah?yeah=1#ok", ), ("http://tarek@localhost/blah", "http://[email protected]/blah"), ] for url, wanted in urls: changed, original, resolved = resolve(url) self.assertEqual(changed, wanted, "%s vs %s" % (original, resolved))
def _dns_lookup(self, url): return resolve(url)[0]