Update admin theme/layout and refresh README details.
Align the project baseline with the latest admin interface styling and layout structure while documenting setup and usage updates in README.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
def test_media_requires_signature(client):
|
||||
response = client.get("/api/v1/media/files/avatars/missing.png")
|
||||
assert response.status_code == 422
|
||||
|
||||
|
||||
def test_media_file_not_found(client):
|
||||
from app.core.media_signing import build_signed_media_url
|
||||
|
||||
signed_url = build_signed_media_url("/api/v1/media/files/avatars/missing.png")
|
||||
response = client.get(signed_url)
|
||||
assert response.status_code == 404
|
||||
assert response.json()["detail"] == "FILE_NOT_FOUND"
|
||||
|
||||
|
||||
def test_media_rejects_non_avatar_path(client):
|
||||
from app.core.media_signing import build_signed_media_url
|
||||
|
||||
signed_url = build_signed_media_url("/api/v1/media/files/other/file.png")
|
||||
response = client.get(signed_url)
|
||||
assert response.status_code == 404
|
||||
assert response.json()["detail"] == "FILE_NOT_FOUND"
|
||||
@@ -0,0 +1,14 @@
|
||||
import pytest
|
||||
|
||||
from app.modules.media.service import AvatarValidationError, validate_and_process_avatar
|
||||
from tests.fixtures import make_test_png
|
||||
|
||||
|
||||
def test_validate_rejects_empty():
|
||||
with pytest.raises(AvatarValidationError, match="INVALID_IMAGE"):
|
||||
validate_and_process_avatar(b"")
|
||||
|
||||
|
||||
def test_validate_rejects_corrupt_bytes():
|
||||
with pytest.raises(AvatarValidationError, match="INVALID_IMAGE"):
|
||||
validate_and_process_avatar(b"not-an-image")
|
||||
Reference in New Issue
Block a user