aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_postprocessor.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_postprocessor.py')
-rw-r--r--test/test_postprocessor.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py
index 6bf887c..00c17b2 100644
--- a/test/test_postprocessor.py
+++ b/test/test_postprocessor.py
@@ -30,13 +30,17 @@ class MockPostprocessorModule(Mock):
class FakeJob():
- def __init__(self):
- self.extractor = extractor.find("test:")
- self.pathfmt = util.PathFormat(self.extractor)
+ def __init__(self, extr=extractor.find("test:")):
+ self.extractor = extr
+ self.pathfmt = util.PathFormat(extr)
self.out = output.NullOutput()
self.get_logger = logging.getLogger
self.hooks = collections.defaultdict(list)
+ def register_hooks(self, hooks, options):
+ for hook, callback in hooks.items():
+ self.hooks[hook].append(callback)
+
class TestPostprocessorModule(unittest.TestCase):
@@ -239,6 +243,15 @@ class MetadataTest(BasePostprocessorTest):
self._trigger()
self.assertEqual(self._output(m), "foo\nbar\nbaz\n")
+ def test_metadata_tags_dict(self):
+ self._create(
+ {"mode": "tags"},
+ {"tags": {"g": ["foobar1", "foobar2"], "m": ["foobarbaz"]}},
+ )
+ with patch("builtins.open", mock_open()) as m:
+ self._trigger()
+ self.assertEqual(self._output(m), "foobar1\nfoobar2\nfoobarbaz\n")
+
def test_metadata_custom(self):
def test(pp_info):
pp = self._create(pp_info, {"foo": "bar"})