Permalink
Browse files

Merge pull request #157 from bobsilverberg/add_status_code

Add status code reporting to url validation failures
  • Loading branch information...
2 parents 5853a6e + 395e300 commit 4f6697e27288d59d2e2fccef61698fc7325a3df8 @m8ttyB m8ttyB committed Dec 12, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 tests/test_notes.py
View
@@ -29,8 +29,9 @@ def test_that_all_links_are_valid(self, mozwebqa):
links = html.findAll('a')
for link in links:
url = self.make_absolute(link['href'], mozwebqa.base_url)
- if not notes_page.is_valid_link(url):
- bad_urls.append('%s is not a valid url' % url)
+ response_code = notes_page.get_response_code(url)
+ if response_code != requests.codes.ok:
+ bad_urls.append('%s is not a valid url - status code: %s.' % (url, response_code))
Assert.equal(0, len(bad_urls), '%s bad urls found: ' % len(bad_urls) + ', '.join(bad_urls))
def make_absolute(self, url, base_url):

0 comments on commit 4f6697e

Please sign in to comment.