We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import pytest, sys, asyncio from hypercorn.config import Config from hypercorn.asyncio import serve from os.path import dirname, join, abspath from src.app import create_app #from src.main import app from quart_cors import cors sys.path.insert(0, abspath(join(dirname(__file__), '../src'))) from common.Authentication import Authentication pytest_plugins = ('pytest_asyncio',) @pytest.fixture async def app_context(): config = Config() config.bind = ["localhost:4433"] config.insecure_bind = ["localhost:8080"] config.worker_class = "asyncio" config.alt_svc_headers = ["h3=\":443\"; ma=3600, h3-29=\":443\"; ma=3600"] config.loglevel = "DEBUG" config.quic_bind = ["localhost:4433"] app = create_app() app = cors(app, allow_credentials=True, allow_origin="https://localhost:4433") asyncio.run(serve(app, config)) async with app.app_context(): yield @pytest.mark.asyncio async def test_tokengeneration_pass(app_context): """ JWT token generation should pass with valid user input parameter """ token = Authentication.generate_token("test_user") assert type(token) is str assert token != ""
Error:
E RuntimeError: Not within an app context
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Error:
The text was updated successfully, but these errors were encountered: