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

Commit

Permalink
Adding test for redirect that we'll need on bouncer.
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonsavage committed Apr 10, 2013
1 parent e505f0c commit 85eb5bb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
@@ -1,4 +1,10 @@
bouncer-tests bouncer-tests
============= =============


Tests for Mozilla's Bouncer Tests for Mozilla's Bouncer

To run these tests, use:

py.test tests/test_redirects.py --baseurl="http://your.url.com"

Use -k to run a specific test.
15 changes: 15 additions & 0 deletions tests/test_redirects.py
Expand Up @@ -126,3 +126,18 @@ def test_redirect_for_firefox_aliases(self, testsetup, product_alias):
): ):
Assert.contains('/%s/' % 'win32', parsed_url.path, Assert.contains('/%s/' % 'win32', parsed_url.path,
'\n %s' % self.response_info(response)) '\n %s' % self.response_info(response))

def test_redirect_for_windows_200_to_2001(self, testsetup):

url = testsetup.base_url
param = {
'product' : 'firefox-20.0',
'os': 'win',
'lang' : 'en-US',
}

response = self._head_request(url, params=param)

parsed_url = urlparse(response.url)

Assert.true('20.0.1' in parsed_url.query, 'Redirect failed using params of %s' % (parsed_url.query))

0 comments on commit 85eb5bb

Please sign in to comment.