Release v0.1.9: enforce Photos API boundary and finalize Server migration
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import json
|
||||
|
||||
|
||||
def test_filesystem_source_cannot_be_created(client):
|
||||
response = client.put(
|
||||
"/api/v1/photo-sources/legacy",
|
||||
json={"name": "NAS directory", "kind": "local", "location": "."},
|
||||
)
|
||||
assert response.status_code == 403
|
||||
assert "Filesystem photo sources are disabled" in response.text
|
||||
|
||||
|
||||
def test_persisted_filesystem_source_cannot_be_read(client, service):
|
||||
service.db.execute(
|
||||
"INSERT INTO app_config(key,payload) VALUES (?,?)",
|
||||
(
|
||||
"photo_source:legacy",
|
||||
json.dumps({"name": "Legacy", "kind": "local", "location": "."}),
|
||||
),
|
||||
)
|
||||
response = client.get("/api/v1/photo-sources/legacy/images")
|
||||
assert response.status_code == 403
|
||||
assert "Filesystem photo sources are disabled" in response.text
|
||||
Reference in New Issue
Block a user