feat: pool set_label

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 12:59:09 +02:00
parent 8b3043f3d4
commit 2b3f2ffc88
2 changed files with 20 additions and 0 deletions
+12
View File
@@ -85,3 +85,15 @@ def test_resolve_slot_rules():
assert pool.resolve_slot(m, 0) == 0 # forced
assert pool.resolve_slot(m, 9) == 2 # clamp high
assert pool.resolve_slot({"active": 0, "slots": [], "next_seq": 1}, -1) == -1 # empty
def test_set_label(tmp_path):
pool.add_image(str(tmp_path), "p1", b"a", ts=1)
m = pool.set_label(str(tmp_path), "p1", 0, "front view")
assert m["slots"][0]["label"] == "front view"
def test_set_label_out_of_range_noop(tmp_path):
pool.add_image(str(tmp_path), "p1", b"a", ts=1)
m = pool.set_label(str(tmp_path), "p1", 5, "x")
assert m["slots"][0]["label"] == ""