feat(immich): write-back (upsert_tag, tag_assets) + _pipeline tag conventions
This commit is contained in:
@@ -48,3 +48,16 @@ def test_download_thumbnail(httpserver):
|
||||
b"\xff\xd8\xffjpegbytes", content_type="image/jpeg")
|
||||
c = ImmichClient(httpserver.url_for(""), "k")
|
||||
assert c.download_thumbnail("a").startswith(b"\xff\xd8\xff")
|
||||
|
||||
|
||||
def test_upsert_tag_returns_id_by_value(httpserver):
|
||||
httpserver.expect_request("/api/tags", method="PUT").respond_with_json(
|
||||
[{"id": "p1", "name": "non-trip", "value": "_pipeline/non-trip"}])
|
||||
c = ImmichClient(httpserver.url_for(""), "k")
|
||||
assert c.upsert_tag("_pipeline/non-trip") == "p1"
|
||||
|
||||
|
||||
def test_tag_assets_posts_ids(httpserver):
|
||||
httpserver.expect_request("/api/tags/p1/assets", method="PUT").respond_with_json({"ok": True})
|
||||
c = ImmichClient(httpserver.url_for(""), "k")
|
||||
c.tag_assets("p1", ["a", "b"]) # should not raise
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
from photoflow.immich import pipeline
|
||||
|
||||
|
||||
def test_constants_and_helpers():
|
||||
assert pipeline.ROOT == "_pipeline"
|
||||
assert pipeline.PROCESSED == "_pipeline/processed"
|
||||
assert pipeline.NON_TRIP == "_pipeline/non-trip"
|
||||
assert pipeline.ai_rating(4) == "_pipeline/ai-rating/4"
|
||||
|
||||
|
||||
def test_is_pipeline_tag():
|
||||
assert pipeline.is_pipeline_tag("_pipeline/processed") is True
|
||||
assert pipeline.is_pipeline_tag("_pipeline") is True
|
||||
assert pipeline.is_pipeline_tag("Italy 2019") is False
|
||||
assert pipeline.is_pipeline_tag("Kiev") is False
|
||||
Reference in New Issue
Block a user