def test_without_protocol(self): """Test domain extraction from URLs, for HTTP, about:, chrome.""" test_domains = ( ('http://example.com', 'example.com'), ('https://www.example.net:8080/abc', 'www.example.net:8080'), ('about:config', 'about:config'), ('chrome://something/exciting', 'chrome://something/exciting'), ) for domain, expected in test_domains: eq_(helpers.without_protocol(domain), expected)
def sorted(cls, err): sortkey = lambda group: (-len(group.opinion_pks), without_protocol(group.key["url"])) res = sorted(cls.all.itervalues(), key=sortkey) return res
def domain(self): return helpers.without_protocol(self.url)