From b5e56c51e491b41f9eb6a895459c185788a377e5 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Mon, 12 Aug 2024 02:42:36 -0400 Subject: New upstream version 1.27.3. --- test/test_postprocessor.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test') diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py index 3e6d1df..edd8575 100644 --- a/test/test_postprocessor.py +++ b/test/test_postprocessor.py @@ -452,6 +452,27 @@ 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_basedirectory(self): + self._create({"base-directory": True}) + + with patch("builtins.open", mock_open()) as m: + self._trigger() + + path = self.pathfmt.basedirectory + "file.ext.json" + m.assert_called_once_with(path, "w", encoding="utf-8") + + def test_metadata_basedirectory_custom(self): + self._create({ + "base-directory": "/home/test", + "directory": "meta", + }) + + with patch("builtins.open", mock_open()) as m: + self._trigger() + + path = "/home/test/meta/file.ext.json" + m.assert_called_once_with(path, "w", encoding="utf-8") + def test_metadata_filename(self): self._create({ "filename" : "{category}_{filename}_/meta/\n\r.data", -- cgit v1.2.3