Esempio n. 1
0
 def with_missing_tld():
     expect(URL(URL_NO_TLD).errors) == [
         "Unable to connect to domain.",
         "URL responded with a non-successful status code: (no response)",
     ]
Esempio n. 2
0
 def with_non_url():
     expect(URL(NON_URL).errors) == [
         "Invalid URL 'example': No schema supplied. Perhaps you meant http://example?",
         "URL responded with a non-successful status code: (no response)",
     ]
Esempio n. 3
0
 def with_invalid_scheme():
     expect(URL(URL_BAD_SCHEME).errors) == [
         "No connection adapters were found for 'foobar://example.com'",
         "URL responded with a non-successful status code: (no response)",
     ]
Esempio n. 4
0
 def with_missing_scheme():
     expect(URL(URL_NO_SCHEME).errors) == [
         "Invalid URL 'example.com': No schema supplied. Perhaps you meant http://example.com?",
         "URL responded with a non-successful status code: (no response)",
     ]
Esempio n. 5
0
 def with_unsuccessful_status_code():
     expect(URL(URL_404).errors) == [
         "URL responded with a non-successful status code: 404",
     ]
Esempio n. 6
0
 def with_valid_url():
     expect(URL(URL_200).errors) == []
Esempio n. 7
0
 def is_based_on_valid_url_and_success_status(url, valid):
     expect(URL(url).valid) == valid
Esempio n. 8
0
 def is_none_with_invalid_url():
     expect(URL(URL_BAD_SCHEME).status_code) == None
Esempio n. 9
0
 def is_based_on_response_status_code(url, valid):
     expect(URL(url).status_code) == valid