24 lines
790 B
Python
24 lines
790 B
Python
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
|