test: config cap under aiohttp's 4 MB frame; own marker id for the upload test

A 4 MB cap could never be reported: the frame limit rejects the message first
and the socket closes with 1009, so the user gets a dropped connection instead
of 'too_large'. 2 MB is ~30x a real three-floor configuration (70 KB measured).

The upload test listed a folder test_ha_upload.py also writes into.
This commit is contained in:
Matysh
2026-07-28 16:11:48 +03:00
parent 3f719cc32a
commit 4418312b0b
2 changed files with 10 additions and 8 deletions
+4 -4
View File
@@ -681,12 +681,12 @@ async def test_upload_never_overwrites_an_existing_attachment(
assert resp.status == 200, await resp.text()
return (await resp.json())["url"]
first = await upload("m1", "manual.pdf", b"ONE")
second = await upload("m1", "manual.pdf", b"TWO")
first = await upload("m9", "manual.pdf", b"ONE")
second = await upload("m9", "manual.pdf", b"TWO")
assert first != second, "the second upload must not take the first name"
folder = os.path.join(hass.config.path(FILES_DIR), "m1")
# the HA test config dir is shared across the module — look only at ours
folder = os.path.join(hass.config.path(FILES_DIR), "m9")
# the HA test config dir is shared across the module — hence our own marker id
names = sorted(
n for n in await hass.async_add_executor_job(os.listdir, folder) if n.startswith("manual")
)