Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: revert the test's responses package workaround #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions tokenserver/verifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,12 @@ def __init__(self, server_url=None, default_issuer=None, timeout=30,
default_issuer = urlparse.urlparse(auth_url).netloc
break
else:
# For non-standard hosting setups, look it up dynamically.
r = requests.get(server_url[:-3] + '/config')
r.raise_for_status()
try:
# For non-standard hosting setups, look it up dynamically.
r = requests.get(server_url[:-3] + '/config')
r.raise_for_status()
try:
default_issuer = r.json()['browserid']['issuer']
except KeyError:
pass
except ValueError as e:
# some tests fail because requests returns a ValueError
# "I/O operation on a closed file"
# this is because response fails to read the empty stream.
# treat it as an empty response.
import logging
logging.getLogger().debug(e)
default_issuer = r.json()['browserid']['issuer']
except KeyError:
pass
self.default_issuer = default_issuer
self.scope = scope
Expand Down