feat(phash): import_settings.phash_threshold (migration 0006) exposed + validated in API
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,30 @@ async def test_patch_rejects_non_object(client):
|
||||
assert resp.status_code == 400
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_import_settings_phash_threshold_default(client):
|
||||
resp = await client.get("/api/settings/import")
|
||||
assert resp.status_code == 200
|
||||
assert (await resp.get_json())["phash_threshold"] == 10
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_patch_phash_threshold(client):
|
||||
resp = await client.patch(
|
||||
"/api/settings/import", json={"phash_threshold": 4}
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
assert (await resp.get_json())["phash_threshold"] == 4
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_patch_phash_threshold_rejects_negative(client):
|
||||
resp = await client.patch(
|
||||
"/api/settings/import", json={"phash_threshold": -1}
|
||||
)
|
||||
assert resp.status_code == 400
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_system_stats_shape(client):
|
||||
resp = await client.get("/api/system/stats")
|
||||
|
||||
Reference in New Issue
Block a user