feat: scan.resolve_index with end-of-batch error

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 16:24:51 +02:00
parent ba8de1253e
commit d5b314f6b6
2 changed files with 24 additions and 0 deletions
+16
View File
@@ -37,3 +37,19 @@ def test_list_images_bad_path_raises(tmp_path):
import pytest
with pytest.raises(NotADirectoryError):
scan.list_images(str(tmp_path / "nope"))
def test_resolve_index_ok():
assert scan.resolve_index(5, 0) == 0
assert scan.resolve_index(5, 4) == 4
def test_resolve_index_out_of_range_raises():
import pytest
with pytest.raises(IndexError):
scan.resolve_index(5, 5)
with pytest.raises(IndexError):
scan.resolve_index(5, -1)
def test_resolve_index_empty_raises():
import pytest
with pytest.raises(FileNotFoundError):
scan.resolve_index(0, 0)