Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #167 from rafaelcaricio/fix-auth-tests
Browse files Browse the repository at this point in the history
Fix auth tests
  • Loading branch information
rafaelcaricio authored Aug 4, 2016
2 parents 17b7e08 + 66e221d commit 95f676a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ python:
install:
- pip install -e .
- pip install coveralls
- pip install flake8
- pip install flake8==2.6.2
script:
- python setup.py test
- python setup.py flake8
after_success:
- coveralls
- coveralls
4 changes: 3 additions & 1 deletion lizzy/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging

import connexion
import werkzeug.exceptions

from lizzy.api import not_found_path_handler, expose_api_schema, health_check
from .serialization import JSONEncoder
Expand All @@ -28,7 +29,8 @@ def setup_webapp(config: configuration.Configuration): # pragma: no cover
flask_app = app.app
flask_app.json_encoder = JSONEncoder

flask_app.errorhandler(404)(not_found_path_handler)
flask_app.register_error_handler(werkzeug.exceptions.NotFound,
not_found_path_handler)

flask_app.add_url_rule('/.well-known/schema-discovery',
'schema_discovery_endpoint',
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pytz
pyyaml
stups-senza>=1.0.40
uwsgi
flask==0.10.1
flask==0.11.1
2 changes: 1 addition & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_security(app, mock_senza):
assert get_stacks.headers['X-Lizzy-Version'] == CURRENT_VERSION

inexistent_url = app.get('/api/does-not-exist', headers=GOOD_HEADERS)
assert inexistent_url.status_code == 403
assert inexistent_url.status_code == 404

invalid_access = app.get('/api/does-not-exist')
assert invalid_access.status_code == 401
Expand Down

0 comments on commit 95f676a

Please sign in to comment.