feat: крролик, по тщ 5 лаба

This commit is contained in:
Enterxx2
2026-11-10 12:38:09 +03:00
parent 1d8dfb7ea4
commit 595a959b96
65 changed files with 2692 additions and 216 deletions
+4 -2
View File
@@ -24,6 +24,7 @@ from helpers import (
psql,
run_janitor,
upload_raw,
wait_attachment,
)
pytestmark = pytest.mark.skipif(
@@ -49,7 +50,7 @@ def wait_upload_works(api: httpx.Client, user: dict, chat_id: str) -> httpx.Resp
deadline = time.monotonic() + READY_TIMEOUT_SEC
while True:
response = upload_raw(api, user, chat_id, png_bytes())
if response.status_code == 201 or time.monotonic() > deadline:
if response.status_code == 202 or time.monotonic() > deadline:
return response
time.sleep(1)
@@ -89,7 +90,8 @@ def test_s3_outage_is_isolated_and_leaves_no_garbage(
compose("up", "-d", "--wait", "s3")
after = wait_upload_works(api, alice, chat["id"])
assert after.status_code == 201, after.text
assert after.status_code == 202, after.text
wait_attachment(api, alice, after.json()["id"])
content = api.get(f"/api/v1/attachments/{before['id']}/content", headers=auth(bob))
assert content.status_code == 200