aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_postprocessor.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2020-11-13 19:17:11 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2020-11-13 19:17:11 -0500
commit29228b3731dde3a707e4b507eedd54a634e3725a (patch)
tree632edf08783da3f40d0077a73c402d11d6af75cc /test/test_postprocessor.py
parentb35d81189c65d5834430cd24ce50d3f5f6392868 (diff)
parent209a3c800871cd68edd2bc7ae661a24ecd496d2d (diff)
Update upstream source from tag 'upstream/1.15.3'
Update to upstream version '1.15.3' with Debian dir e4e814274dce1884e0f01e4c1dcfab7a594ef987
Diffstat (limited to 'test/test_postprocessor.py')
-rw-r--r--test/test_postprocessor.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py
index ff98477..524e501 100644
--- a/test/test_postprocessor.py
+++ b/test/test_postprocessor.py
@@ -235,18 +235,20 @@ class MetadataTest(BasePostprocessorTest):
self.assertEqual(self._output(m), "foo\nbar\nbaz\n")
def test_metadata_custom(self):
- pp = self._create(
- {"mode": "custom", "format": "{foo}\n{missing}\n"},
- {"foo": "bar"},
- )
- self.assertEqual(pp.write, pp._write_custom)
- self.assertEqual(pp.extension, "txt")
- self.assertTrue(pp.contentfmt)
+ def test(pp_info):
+ pp = self._create(pp_info, {"foo": "bar"})
+ self.assertEqual(pp.write, pp._write_custom)
+ self.assertEqual(pp.extension, "txt")
+ self.assertTrue(pp.contentfmt)
- with patch("builtins.open", mock_open()) as m:
- pp.prepare(self.pathfmt)
- pp.run(self.pathfmt)
- self.assertEqual(self._output(m), "bar\nNone\n")
+ with patch("builtins.open", mock_open()) as m:
+ pp.prepare(self.pathfmt)
+ pp.run(self.pathfmt)
+ self.assertEqual(self._output(m), "bar\nNone\n")
+
+ test({"mode": "custom", "content-format": "{foo}\n{missing}\n"})
+ test({"mode": "custom", "content-format": ["{foo}", "{missing}"]})
+ test({"mode": "custom", "format": "{foo}\n{missing}\n"})
def test_metadata_extfmt(self):
pp = self._create({