Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add status code reporting to url validation failures #157

merged 1 commit into from Dec 12, 2012


None yet
2 participants

bobsilverberg commented Dec 12, 2012

This will help us identify the root problem when url checking generates failures. I have only updated this one test file as a POC and to see if others approve of the code change. If this is acceptable then I will update all of the other tests.

@m8ttyB m8ttyB commented on the diff Dec 12, 2012

@@ -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))

m8ttyB Dec 12, 2012


wicked - nice


m8ttyB commented Dec 12, 2012

low-risk: merging!

Thanks @bobsilverberg

m8ttyB added a commit that referenced this pull request Dec 12, 2012

Merge pull request #157 from bobsilverberg/add_status_code
Add status code reporting to url validation failures

@m8ttyB m8ttyB merged commit 4f6697e into mozilla:master Dec 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment