Esempio n. 1
0
 def test_should_normalize_unicode_urls(self):
     for url in [
             u'https://s3.amazonaws.com/game-screenshots/star_wars\u2122_kotor_cover.png',
             u'https://s3.amazonaws.com/game-screenshots/star_wars™_kotor_cover.png'
     ]:
         expect(loader._normalize_url(url)).\
             to_equal('https://s3.amazonaws.com/game-screenshots/star_wars%E2%84%A2_kotor_cover.png')
Esempio n. 2
0
 def test_should_normalize_quoted_url(self):
     url = ("https%3A//www.google.ca/images/branding/googlelogo/2x"
            "/googlelogo_color_272x92dp.png")
     expected = ("https://www.google.ca/images/branding/googlelogo/2x"
                 "/googlelogo_color_272x92dp.png")
     result = loader._normalize_url(url)
     expect(result).to_equal(expected)
 def test_should_normalize_unicode_urls(self):
     for url in [
         u"https://s3.amazonaws.com/game-screenshots/star_wars\u2122_kotor_cover.png",
         u"https://s3.amazonaws.com/game-screenshots/star_wars™_kotor_cover.png",
     ]:
         expect(loader._normalize_url(url)).to_equal(
             "https://s3.amazonaws.com/game-screenshots/star_wars%E2%84%A2_kotor_cover.png"
         )
Esempio n. 4
0
 def test_should_normalize_url(self):
     for url in ['http://some.url', 'some.url']:
         expect(loader._normalize_url(url)).to_equal('http://some.url')
Esempio n. 5
0
 def test_should_normalize_quoted_url(self):
     url = 'https%3A//www.google.ca/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
     expected = 'https://www.google.ca/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
     result = loader._normalize_url(url)
     expect(result).to_equal(expected)
Esempio n. 6
0
 def test_should_normalize_url_but_keep_quotes_after_the_domain(self):
     for url in ['http://some.url/my image', 'some.url/my%20image']:
         expect(loader._normalize_url(url)).to_equal('http://some.url/my%20image')
Esempio n. 7
0
 def test_should_normalize_url(self):
     for url in ['http://some.url', 'some.url']:
         expect(loader._normalize_url(url)).to_equal('http://some.url')
Esempio n. 8
0
 def topic(self):
     return loader._normalize_url('some.url')
Esempio n. 9
0
 def test_should_normalize_url_but_keep_quotes_after_the_domain(self):
     for url in ['http://some.url/my image', 'some.url/my%20image']:
         expect(loader._normalize_url(url)).to_equal(
             'http://some.url/my%20image')
Esempio n. 10
0
 def topic(self):
     return loader._normalize_url('some.url')
Esempio n. 11
0
 def test_should_normalize_url(self):
     for url in ["http://some.url", "some.url"]:
         expect(loader._normalize_url(url)).to_equal("http://some.url")
Esempio n. 12
0
def _normalize_url(url):
    return http_loader._normalize_url(url)
Esempio n. 13
0
 def test_should_mantain_https_without_scheme(self):
     url = "https://some.url"
     expect(loader._normalize_url(url)).to_equal('https://some.url')
Esempio n. 14
0
 def test_should_follow_https_scheme(self):
     url = "some.url"
     expect(loader._normalize_url(url,
                                  "https")).to_equal('https://some.url')
 def test_should_normalize_url(self):
     for url in ["http://some.url", "some.url"]:
         expect(loader._normalize_url(url)).to_equal("http://some.url")
Esempio n. 16
0
 def topic(self):
     return loader._normalize_url("http://some.url")