aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_postprocessor.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-06-05 00:33:56 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2022-06-05 00:33:56 -0400
commit25442ea49f031d4d2df3353dd7e9ad2080e332da (patch)
tree14c2ee86b8d10cf0f79b4cd3ce8d6a34ebe52eba /test/test_postprocessor.py
parentad61a6d8122973534ab63df48f6090954bc73db6 (diff)
New upstream version 1.22.1.upstream/1.22.1
Diffstat (limited to 'test/test_postprocessor.py')
-rw-r--r--test/test_postprocessor.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py
index e23cfa2..c382c0e 100644
--- a/test/test_postprocessor.py
+++ b/test/test_postprocessor.py
@@ -329,12 +329,22 @@ class MetadataTest(BasePostprocessorTest):
path = self.pathfmt.realdirectory + "test_file__meta_.data"
m.assert_called_once_with(path, "w", encoding="utf-8")
+ def test_metadata_stdout(self):
+ self._create({"filename": "-", "indent": None})
+
+ with patch("sys.stdout", Mock()) as m:
+ self._trigger()
+
+ self.assertEqual(self._output(m), """\
+{"category": "test", "extension": "ext", "filename": "file"}
+""")
+
@staticmethod
def _output(mock):
return "".join(
call[1][0]
for call in mock.mock_calls
- if call[0] == "().write"
+ if call[0].endswith("write")
)