def test_lookup_url_exception(self): url = None info("Requested empty url") assert_exception(lookup_url, SafeBrowsingException, "Check if empty url throws Exception", args=url)
def test_submit_google_url(self): url = "google.com" info("Requested url - {}".format(url)) assert_exception( submit, UrlscanException, "Check if submit with google.com throws UrlscanException", args=url)
def test_api_key_check(self): if os.getenv('SAFEBROWSING_API_KEY'): assert_no_exception( check_apikey, ApiKeyException, "Check if apikey verification does not throw Exception") else: assert_exception(check_apikey, ApiKeyException, "Check if apikey verification throws Exception")
def test_submit_wrong_url(self): url = "ftp://localhost" info("Requested url - {}".format(url)) assert_exception( submit, UrlscanException, "Check if submit with wrong url throws UrlscanException", args=url)