Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #18 from m8ttyB/update_negative_case
Update negative case
  • Loading branch information
stephendonner committed Oct 15, 2012
2 parents 4a0c882 + 4f60c5f commit 5cfec62
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_redirects.py
Expand Up @@ -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))

Expand Down

0 comments on commit 5cfec62

Please sign in to comment.