Release v0.1.6: identify gallery destinations by provider and NAS name [skip ci]

This commit is contained in:
渡口浪人
2026-10-16 18:58:01 +08:00
parent d3f40cfea3
commit 106b6f311f
19 changed files with 218 additions and 13 deletions
+19
View File
@@ -423,3 +423,22 @@ def test_scoped_client_operation_isolation(client, service):
assert [op["operation_id"] for op in client.get("/api/v1/operations").json()] == [
own
]
def test_settings_exposes_storage_display_name(client, service):
service.settings.storage_name = "Family NAS"
result = client.get("/api/v1/settings").json()
assert result["storage_name"] == "Family NAS"
destinations = {d["id"]: d for d in result["gallery_destinations"]}
assert set(destinations) == {"cloud", "local"}
assert destinations["cloud"]["name"] == "KoKonna"
assert destinations["local"]["name"] == "Family NAS"
assert all(d["connected"] and d["supports_upload"] for d in destinations.values())
assert "test-frame-token" not in str(result)
def test_storage_display_name_environment(monkeypatch):
monkeypatch.setenv("FRAME_FLOW_STORAGE_NAME", " Family NAS ")
assert Settings().storage_name == "Family NAS"
monkeypatch.setenv("FRAME_FLOW_STORAGE_NAME", " ")
assert Settings().storage_name == "NAS"