Fix cookie tests and pep8
The cookie tests needed to confirm that there would be a failure if cookies were expected but there was no set-cookie in the prior response.
This commit is contained in:
parent
1947ce952a
commit
4c3cc61ee9
@ -29,8 +29,8 @@ import unittest
|
|||||||
from unittest import case
|
from unittest import case
|
||||||
|
|
||||||
import six
|
import six
|
||||||
from six.moves.urllib import parse as urlparse
|
|
||||||
from six.moves import http_cookies
|
from six.moves import http_cookies
|
||||||
|
from six.moves.urllib import parse as urlparse
|
||||||
import wsgi_intercept
|
import wsgi_intercept
|
||||||
|
|
||||||
from gabbi import __version__
|
from gabbi import __version__
|
||||||
|
@ -6,7 +6,14 @@ tests:
|
|||||||
set-cookie: session=1234; domain=.example.com
|
set-cookie: session=1234; domain=.example.com
|
||||||
|
|
||||||
- name: use that cookie in a URL
|
- name: use that cookie in a URL
|
||||||
desc: just to get it somewhere we can test it and confirm domain is dropped
|
desc: to get it somewhere we can test it and confirm domain is dropped
|
||||||
GET: /cookie?$COOKIE
|
GET: /foobar?$COOKIE
|
||||||
response_headers:
|
response_headers:
|
||||||
x-gabbi-url: $SCHEME://$NETLOC/cookie?session=1234
|
x-gabbi-url: $SCHEME://$NETLOC/foobar?session=1234
|
||||||
|
|
||||||
|
- name: confirm no cookies causes error
|
||||||
|
desc: "this will cause data unavailable: set-cookie"
|
||||||
|
xfail: true
|
||||||
|
GET: /foobar?$COOKIE
|
||||||
|
response_headers:
|
||||||
|
x-gabbi-url: $SCHEME://$NETLOC/foobar
|
||||||
|
@ -7,12 +7,12 @@ shopt -s nocasematch
|
|||||||
[[ "${GABBI_SKIP_NETWORK:-false}" == "true" ]] && SKIP=7 || SKIP=2
|
[[ "${GABBI_SKIP_NETWORK:-false}" == "true" ]] && SKIP=7 || SKIP=2
|
||||||
shopt -u nocasematch
|
shopt -u nocasematch
|
||||||
|
|
||||||
GREP_FAIL_MATCH='expected failures=11,'
|
GREP_FAIL_MATCH='expected failures=12,'
|
||||||
GREP_SKIP_MATCH="skipped=$SKIP,"
|
GREP_SKIP_MATCH="skipped=$SKIP,"
|
||||||
GREP_UXSUC_MATCH='unexpected successes=1'
|
GREP_UXSUC_MATCH='unexpected successes=1'
|
||||||
# This skip is always 2 because the pytest tests don't
|
# This skip is always 2 because the pytest tests don't
|
||||||
# run the live tests.
|
# run the live tests.
|
||||||
PYTEST_MATCH='2 skipped, 11 xfailed'
|
PYTEST_MATCH='2 skipped, 12 xfailed'
|
||||||
|
|
||||||
python setup.py testr && \
|
python setup.py testr && \
|
||||||
for match in "${GREP_FAIL_MATCH}" "${GREP_UXSUC_MATCH}" "${GREP_SKIP_MATCH}"; do
|
for match in "${GREP_FAIL_MATCH}" "${GREP_UXSUC_MATCH}" "${GREP_SKIP_MATCH}"; do
|
||||||
|
Loading…
Reference in New Issue
Block a user