Browse Source

🎨 Auto format

pull/14984/head
pre-commit-ci-lite[bot] 5 months ago
committed by GitHub
parent
commit
727ed41b9b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      fastapi/routing.py
  2. 4
      tests/test_router_mount.py

6
fastapi/routing.py

@ -1550,8 +1550,10 @@ class APIRouter(routing.Router):
prefix + route.path, route.endpoint, name=route.name
)
elif isinstance(route, routing.Mount):
self.mount(prefix + router.prefix + route.path, route.app, name=route.name)
self.mount(
prefix + router.prefix + route.path, route.app, name=route.name
)
for handler in router.on_startup:
self.add_event_handler("startup", handler)
for handler in router.on_shutdown:

4
tests/test_router_mount.py

@ -1,4 +1,4 @@
from fastapi import FastAPI, APIRouter
from fastapi import APIRouter, FastAPI
from fastapi.testclient import TestClient
@ -22,4 +22,4 @@ def test_mount_on_router():
client = TestClient(app)
assert client.get("/api/app").status_code == 200
assert client.get("/api/subapi/sub").status_code == 200
assert client.get("/api/subapi/sub").status_code == 200

Loading…
Cancel
Save