def test_invalidUrlScheme(self): with pytest.raises(ValueError): UrlChecker('ftp://')
def test_emptyUrlScheme(self): with pytest.raises(ValueError): UrlChecker('file')
def test_invalidUrl(self): with pytest.raises(ValueError): UrlChecker('http://[')
def test_isHttps(self): checker = UrlChecker(availableUrlHttps) assert not checker.isHttp() assert checker.isHttps()
def test_HttpAndHttpsAvailable(self): checker = UrlChecker(availableUrlHttp) assert checker.isAvailableHttp() assert checker.isAvailableHttps() assert checker.getHttp() == availableUrlHttp assert checker.getHttps() == availableUrlHttps
def test_isUnavailable(self): assert not UrlChecker.isAvailable(unavailableUrl)
def test_isAvailable(self): assert UrlChecker.isAvailable(availableUrlHttp)