Esempio n. 1
0
 def test_invalidUrlScheme(self):
     with pytest.raises(ValueError):
         UrlChecker('ftp://')
Esempio n. 2
0
 def test_emptyUrlScheme(self):
     with pytest.raises(ValueError):
         UrlChecker('file')
Esempio n. 3
0
 def test_invalidUrl(self):
     with pytest.raises(ValueError):
         UrlChecker('http://[')
Esempio n. 4
0
 def test_isHttps(self):
     checker = UrlChecker(availableUrlHttps)
     assert not checker.isHttp()
     assert checker.isHttps()
Esempio n. 5
0
 def test_HttpAndHttpsAvailable(self):
     checker = UrlChecker(availableUrlHttp)
     assert checker.isAvailableHttp()
     assert checker.isAvailableHttps()
     assert checker.getHttp() == availableUrlHttp
     assert checker.getHttps() == availableUrlHttps
Esempio n. 6
0
 def test_isUnavailable(self):
     assert not UrlChecker.isAvailable(unavailableUrl)
Esempio n. 7
0
 def test_isAvailable(self):
     assert UrlChecker.isAvailable(availableUrlHttp)