Permalink
Browse files

Merge pull request #18 from m8ttyB/update_negative_case

Update negative case
  • Loading branch information...
2 parents 4a0c882 + 4f60c5f commit 5cfec6203571668df9b6aa289366276992050ef4 @stephendonner stephendonner committed Oct 15, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 tests/test_redirects.py
View
@@ -14,20 +14,23 @@
class TestRedirects(Base):
- @pytest.mark.parametrize('url', ["http://download.allizom.org/", "https://download.allizom.org/"])
- def test_that_checks_redirect_using_incorrect_query_values(self, url):
+ def test_that_checks_redirect_using_incorrect_query_values(self, testsetup):
param = {
'product': 'firefox-16.0b6',
'lang': 'kitty_language',
'os': 'stella'
}
-
+ url = testsetup.base_url
response = self._head_request(url, params=param)
Assert.equal(response.status_code, requests.codes.not_found, 'Failed on %s \nUsing %s' % (url, param))
parsed_url = urlparse(response.url)
- Assert.equal(parsed_url.scheme, 'https', 'Failed on %s \nUsing %s' % (url, param))
+ Assert.equal(parsed_url.scheme, 'http',
+ 'Failed by redirected to HTTPS on %s \n \
+ Using %s \n \
+ Redirect to %s' % \
+ (url, param, response.url))
Assert.equal(parsed_url.netloc, urlparse(url).netloc, 'Failed on %s \nUsing %s' % (url, param))
Assert.equal(parsed_url.query, urlencode(param), 'Failed on %s \nUsing %s' % (url, param))

0 comments on commit 5cfec62

Please sign in to comment.