Skip to content

Commit 25c467a

Browse files
committed
Fixing tests
1 parent 0afb216 commit 25c467a

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

jwt_proxy/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
def create_app(testing=False, cli=False):
1010
"""Application factory, used to create application"""
1111
app = Flask("jwt_proxy")
12+
app.json = CustomJSONProvider(app)
1213
register_blueprints(app)
1314
configure_app(app)
14-
print("Configuring")
1515
return app
1616

1717

@@ -23,7 +23,6 @@ def register_blueprints(app):
2323
def configure_app(app):
2424
"""Load successive configs - overriding defaults"""
2525
app.config.from_object("jwt_proxy.config")
26-
app.json = CustomJSONProvider(app)
2726
configure_logging(app)
2827

2928

tests/test_api.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
import unittest
2-
from flask import Flask
3-
from jwt_proxy.api import blueprint, proxy_request, validate_jwt, smart_configuration, config_settings
4-
import json
52
from unittest.mock import patch, MagicMock
3+
import json
64
import jwt
5+
from jwt_proxy.api import proxy_request
6+
from jwt_proxy.app import create_app
77

88
class TestAuthBlueprint(unittest.TestCase):
99
def setUp(self):
1010
"""Set up a test Flask app and client"""
11-
self.app = Flask(__name__)
11+
self.app = create_app()
1212
self.app.config['TESTING'] = True
13-
self.app.config['UPSTREAM_SERVER'] = 'http://example.com'
14-
self.app.config['JWKS_URL'] = 'http://jwks.example.com'
15-
self.app.config['PATH_WHITELIST'] = ['/whitelisted']
16-
self.app.config['OIDC_AUTHORIZE_URL'] = 'http://authorize.example.com'
17-
self.app.config['OIDC_TOKEN_URI'] = 'http://token.example.com'
18-
self.app.config['OIDC_TOKEN_INTROSPECTION_URI'] = 'http://introspection.example.com'
19-
self.app.register_blueprint(blueprint)
2013
self.client = self.app.test_client()
2114

2215
@patch('requests.request')

0 commit comments

Comments
 (0)