fix
Tests / test_and_lint (push) Successful in 18s

This commit is contained in:
2026-10-08 12:21:50 +02:00
parent b65282972e
commit c36b9d1df4
2 changed files with 40 additions and 4 deletions
+4 -4
View File
@@ -60,15 +60,15 @@ class MetadataWriter:
force_sidecar: bool = False,
append: bool = True,
):
self.path = Path
self.force_sidecar = force_sidecar
self.append = append
self.path: Path = path
self.force_sidecar: bool = force_sidecar
self.append: bool = append
self._metadata: XmpMetadata | None = None
@property
def sidecar_path(self) -> Path:
return Path()
return Path(str(self.path) + ".xmp")
def get_metadata(self, *args, **kwargs) -> Any:
try:
+36
View File
@@ -12,20 +12,56 @@ def make_dng_file(tmp_path):
src = PATHS_DNG_EXAMPLES[index]
dst = tmp_path / f"copy_{index}_{src.name}"
return dst
return _make
@pytest.fixture
def dng_file(make_dng):
return make_dng()
def test_read_metadata(make_dng_file):
"""primitive test for `MetadataWriter`"""
file_path = make_dng_file()
result = MetadataWriter(file_path)
assert result
@pytest.mark.parametrize("idx", range(len(PATHS_DNG_EXAMPLES)))
def test_read_metadata_sidecar_path(make_dng_file, idx):
file_path = make_dng_file(idx)
metadata_writer = MetadataWriter(file_path)
print(metadata_writer.sidecar_path)
assert isinstance(metadata_writer.sidecar_path, Path)
assert str(metadata_writer.sidecar_path).lower().endswith(".dng.xmp")
def test_get_metadata():
# TODO: Parametrized test on querying metadata fields
...
def test_set_metadata():
# TODO: Paramtrized test on setting metadata fields
...
def test_set_caption_on_empty():
# TODO
...
def test_set_caption_on_existing():
# TODO
...
def test_set_keywords_on_empty():
# TODO
...
def test_set_keywords_on_existing():
# TODO
...