summaryrefslogtreecommitdiffstats
path: root/test/test_postprocessor.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-04-15 05:25:37 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2025-04-15 05:25:37 -0400
commitb830dc03b3b7c9dd119648e1be9c1145d56e096c (patch)
treee9d03b6b4ab93990243c0038c20ada2464fa4072 /test/test_postprocessor.py
parent662e5ac868a5c1a3e7bc95b37054b3a0ca4db74f (diff)
New upstream version 1.29.4.upstream/1.29.4
Diffstat (limited to 'test/test_postprocessor.py')
-rw-r--r--test/test_postprocessor.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py
index 2941b81..8b073b4 100644
--- a/test/test_postprocessor.py
+++ b/test/test_postprocessor.py
@@ -511,6 +511,17 @@ class MetadataTest(BasePostprocessorTest):
path = self.pathfmt.realdirectory + "../json/12500/file.ext.json"
m.assert_called_once_with(path, "w", encoding="utf-8")
+ def test_metadata_directory_empty(self):
+ self._create(
+ {"directory": []},
+ )
+
+ with patch("builtins.open", mock_open()) as m:
+ self._trigger()
+
+ path = self.pathfmt.realdirectory + "./file.ext.json"
+ m.assert_called_once_with(path, "w", encoding="utf-8")
+
def test_metadata_basedirectory(self):
self._create({"base-directory": True})
@@ -544,6 +555,16 @@ class MetadataTest(BasePostprocessorTest):
path = self.pathfmt.realdirectory + "test_file__meta_.data"
m.assert_called_once_with(path, "w", encoding="utf-8")
+ def test_metadata_meta_path(self):
+ self._create({
+ "metadata-path": "_meta_path",
+ })
+
+ self._trigger()
+
+ self.assertEqual(self.pathfmt.kwdict["_meta_path"],
+ self.pathfmt.realpath + ".json")
+
def test_metadata_stdout(self):
self._create({"filename": "-", "indent": None, "sort": True})