Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Update negative case #18

Merged
merged 2 commits into from over 1 year ago

2 participants

Matt Brandt Stephen Donner
Matt Brandt
Collaborator

Just a few small updates

  • I removed the pytest parameters in favor of using --baseurl.
  • Changed the assertion to verify the schema remains http. Previously it was asserting that http redirects to https.
  • Updated the assertion error message to be a little bit more verbose.
Stephen Donner

"I suppose this message"

Stephen Donner stephendonner merged commit 5cfec62 into from October 15, 2012
Stephen Donner stephendonner closed this October 15, 2012
Matt Brandt
Collaborator

I forgot to note that with this change the test fails when run against stage; --baseurl=http://download.allizom.org.

**see bug 683388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 7 additions and 4 deletions. Show diff stats Hide diff stats

  1. 11  tests/test_redirects.py
11  tests/test_redirects.py
@@ -14,20 +14,23 @@
14 14
 
15 15
 class TestRedirects(Base):
16 16
 
17  
-    @pytest.mark.parametrize('url', ["http://download.allizom.org/", "https://download.allizom.org/"])
18  
-    def test_that_checks_redirect_using_incorrect_query_values(self, url):
  17
+    def test_that_checks_redirect_using_incorrect_query_values(self, testsetup):
19 18
         param = {
20 19
             'product': 'firefox-16.0b6',
21 20
             'lang': 'kitty_language',
22 21
             'os': 'stella'
23 22
         }
24  
-
  23
+        url = testsetup.base_url
25 24
         response = self._head_request(url, params=param)
26 25
 
27 26
         Assert.equal(response.status_code, requests.codes.not_found, 'Failed on %s \nUsing %s' % (url, param))
28 27
 
29 28
         parsed_url = urlparse(response.url)
30  
-        Assert.equal(parsed_url.scheme, 'https', 'Failed on %s \nUsing %s' % (url, param))
  29
+        Assert.equal(parsed_url.scheme, 'http', 
  30
+        'Failed by redirected to HTTPS on %s \n \
  31
+        Using %s \n \
  32
+        Redirect to %s' % \
  33
+        (url, param, response.url)) 
31 34
         Assert.equal(parsed_url.netloc, urlparse(url).netloc, 'Failed on %s \nUsing %s' % (url, param))
32 35
         Assert.equal(parsed_url.query, urlencode(param), 'Failed on %s \nUsing %s' % (url, param))
33 36
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.