Exemplo n.º 1
0
 def test_reformat_weburl_none_returns_none(self):
     self.assertIsNone(reformat_weburl(None))
Exemplo n.º 2
0
 def test_reformat_weburl_keeps_https_if_present(self):
     url = 'https://www.domain.com'
     self.assertEqual(reformat_weburl(url), url)
Exemplo n.º 3
0
 def test_reformat_weburl_keeps_complex_url(self):
     url = 'https://www.domain.com/path/to/page?query=string&foo=bar'
     self.assertEqual(reformat_weburl(url), url)
Exemplo n.º 4
0
 def test_reformat_weburl_notavailable_returns_none(self):
     self.assertIsNone(reformat_weburl('www.notavailable.org'))
Exemplo n.º 5
0
 def test_reformat_weburl_adds_http_if_not_present(self):
     self.assertEqual(
         reformat_weburl('www.domain.com'),
         'http://www.domain.com'
     )
Exemplo n.º 6
0
 def test_reformat_weburl_empty_string_returns_none(self):
     self.assertIsNone(reformat_weburl(''))
Exemplo n.º 7
0
 def test_reformat_weburl_invalid_returns_none(self):
     self.assertIsNone(reformat_weburl('foo bar'))
Exemplo n.º 8
0
 def test_reformat_weburl_none_returns_none(self):
     self.assertIsNone(reformat_weburl(None))
Exemplo n.º 9
0
 def test_reformat_weburl_empty_string_returns_none(self):
     self.assertIsNone(reformat_weburl(''))
Exemplo n.º 10
0
 def test_reformat_weburl_keeps_complex_url(self):
     url = 'https://www.domain.com/path/to/page?query=string&foo=bar'
     self.assertEqual(reformat_weburl(url), url)
Exemplo n.º 11
0
 def test_reformat_weburl_keeps_https_if_present(self):
     url = 'https://www.domain.com'
     self.assertEqual(reformat_weburl(url), url)
Exemplo n.º 12
0
 def test_reformat_weburl_adds_http_if_not_present(self):
     self.assertEqual(reformat_weburl('www.domain.com'),
                      'http://www.domain.com')
Exemplo n.º 13
0
 def test_reformat_weburl_notavailable_returns_none(self):
     self.assertIsNone(reformat_weburl('www.notavailable.org'))
Exemplo n.º 14
0
 def test_reformat_weburl_invalid_returns_none(self):
     self.assertIsNone(reformat_weburl('foo bar'))