forked from mtusi2026/mtusi2026lab5
feat: крролик, по тщ 5 лаба
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user