コード例 #1
0
ファイル: tests.py プロジェクト: chowse/reporter
 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)
コード例 #2
0
ファイル: generate_sites.py プロジェクト: chowse/reporter
 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
コード例 #3
0
ファイル: models.py プロジェクト: chowse/reporter
 def domain(self):
     return helpers.without_protocol(self.url)