aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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")
)