Skip to content

Commit 6ce4f1d

Browse files
[PR #11666/1590c860 backport][3.13] add xfail test for #11665 (#11671)
**This is a backport of PR #11666 as merged into master (1590c86).** Co-authored-by: Alastair <[email protected]>
1 parent 7a86158 commit 6ce4f1d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_web_urldispatcher.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,28 @@ async def get(self) -> web.Response:
986986
await r.release()
987987

988988

989+
@pytest.mark.xfail(reason="https://github.com/aio-libs/aiohttp/issues/11665")
990+
async def test_subapp_domain_routing_same_path(aiohttp_client: AiohttpClient) -> None:
991+
app = web.Application()
992+
sub_app = web.Application()
993+
994+
async def mainapp_handler(request: web.Request) -> web.Response:
995+
assert False
996+
997+
async def subapp_handler(request: web.Request) -> web.Response:
998+
return web.Response(text="SUBAPP")
999+
1000+
app.router.add_get("/", mainapp_handler)
1001+
sub_app.router.add_get("/", subapp_handler)
1002+
app.add_domain("different.example.com", sub_app)
1003+
1004+
client = await aiohttp_client(app)
1005+
async with client.get("/", headers={"Host": "different.example.com"}) as r:
1006+
assert r.status == 200
1007+
result = await r.text()
1008+
assert result == "SUBAPP"
1009+
1010+
9891011
async def test_route_with_regex(aiohttp_client: AiohttpClient) -> None:
9901012
"""Test a route with a regex preceded by a fixed string."""
9911013
app = web.Application()

0 commit comments

Comments
 (0)