Beispiel #1
0
 def test_passed_in_two_success_urls(self):
     """Passed in two successful urls and since we don't care about those, doesn't give anything"""
     self.assertEqual(
         validate_urls([
             "http://httpbin.org/status/200",
             "http://httpbin.org/status/200"
         ]), [])
Beispiel #2
0
 def test_passed_in_two_properly_formatted_failing_urls(self):
     self.assertEqual(
         validate_urls([
             "http://httpbin.org/status/404",
             "http://httpbin.org/status/500"
         ]),
         [("http://httpbin.org/status/404", 404,
           "Is a non-200 result code"),
          ("http://httpbin.org/status/500", 500, "Is a non-200 result code")
          ])
Beispiel #3
0
 def test_passed_in_empty_list(self):
     """Passed in empty list and got empty list right back"""
     self.assertEqual(validate_urls([]), [])
Beispiel #4
0
 def test_passed_in_a_single_invalid_url(self):
     """Invalid URLs have a special return format"""
     self.assertEqual(validate_urls(["http://???"]), [
         ("http://???", None, "Invalid URL 'http://???': No host supplied")
     ])
Beispiel #5
0
 def test_passed_in_a_single_properly_formatted_failing_url(self):
     """Passed in a single failing url, successfully"""
     self.assertEqual(validate_urls(["http://httpbin.org/status/410"]), [
         ("http://httpbin.org/status/410", 410, "Is a non-200 result code")
     ])