Skip to content

Commit ec0f7aa

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

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
@@ -987,6 +987,28 @@ async def get(self) -> web.Response:
987987
await r.release()
988988

989989

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

0 commit comments

Comments
 (0)