Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Dec 15, 2023
1 parent b48d3f9 commit e1fcff5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/uapi/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def adapted(
return res


App: TypeAlias = DjangoApp
App: TypeAlias = DjangoApp[FrameworkResponse]


def _make_django_incanter(converter: Converter) -> Incanter:
Expand Down
4 changes: 2 additions & 2 deletions tests/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from flask import Response, request
from uapi import ResponseException
from uapi.flask import App
from uapi.flask import App, FlaskApp
from uapi.status import NoContent
from uapi.types import Method, RouteName

Expand Down Expand Up @@ -73,7 +73,7 @@ def request_method_native(req_method: Method) -> Response:
return app


async def run_on_flask(app: App, port: int, shutdown_event: Event):
async def run_on_flask(app: FlaskApp, port: int, shutdown_event: Event):
config = Config()
config.bind = [f"localhost:{port}"]

Expand Down
7 changes: 4 additions & 3 deletions tests/sessions/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

from uapi.aiohttp import App as AiohttpApp
from uapi.cookies import CookieSettings
from uapi.flask import FlaskApp
from uapi.flask import App as FlaskApp
from uapi.flask import FlaskApp as OriginFlaskApp
from uapi.quart import App as QuartApp
from uapi.sessions import Session, configure_secure_sessions
from uapi.starlette import App as StarletteApp
Expand All @@ -25,7 +26,7 @@ def configure_secure_session_app(
app, "test", settings=CookieSettings(max_age=2, secure=False)
)

if isinstance(app, FlaskApp):
if isinstance(app, OriginFlaskApp):

@app.get("/")
def index(session: Session) -> str:
Expand Down Expand Up @@ -77,7 +78,7 @@ async def secure_cookie_session_app(
await t

elif request.param == "flask":
flask_app = FlaskApp[None]()
flask_app = FlaskApp()
configure_secure_session_app(flask_app)
shutdown_event = Event()
t = create_task(run_on_flask(flask_app, unused_tcp_port, shutdown_event))
Expand Down

0 comments on commit e1fcff5

Please sign in to comment.