Skip to content

Commit

Permalink
Changing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Filienko committed Aug 14, 2024
1 parent 103776f commit e2eaade
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import unittest
from unittest.mock import patch, MagicMock
from flask import Flask
from jwt_proxy.api import blueprint, proxy_request, validate_jwt, smart_configuration, config_settings
import json
from unittest.mock import patch, MagicMock
import jwt
from jwt_proxy.api import proxy_request
from jwt_proxy.app import create_app

class TestAuthBlueprint(unittest.TestCase):
def setUp(self):
"""Set up a test Flask app and client"""
self.app = create_app(testing=True)
self.app = Flask(__name__)
self.app.config['TESTING'] = True
self.app.config['UPSTREAM_SERVER'] = 'http://example.com'
self.app.config['JWKS_URL'] = 'http://jwks.example.com'
self.app.config['PATH_WHITELIST'] = ['/whitelisted']
self.app.config['OIDC_AUTHORIZE_URL'] = 'http://authorize.example.com'
self.app.config['OIDC_TOKEN_URI'] = 'http://token.example.com'
self.app.config['OIDC_TOKEN_INTROSPECTION_URI'] = 'http://introspection.example.com'
self.app.register_blueprint(blueprint)
self.client = self.app.test_client()

@patch('requests.request')
Expand All @@ -23,6 +30,7 @@ def test_proxy_request(self, mock_request):
req.method = 'GET'
req.headers = {'Authorization': 'Bearer token'}
req.args = {'param': 'value'}
req.json = None
req.data = None

response = proxy_request(req, 'http://example.com/api')
Expand Down

0 comments on commit e2eaade

Please sign in to comment.