diff --git a/src/packerlicious/post_processor.py b/src/packerlicious/post_processor.py index 613a45a..893b8a2 100644 --- a/src/packerlicious/post_processor.py +++ b/src/packerlicious/post_processor.py @@ -320,6 +320,7 @@ class Manifest(PackerPostProcessor): props = { 'output': (str, False), + 'custom_data': (dict, False), 'strip_path': (validator.boolean, False), } diff --git a/tests/packerlicious/test_post_processor_manifest.py b/tests/packerlicious/test_post_processor_manifest.py index b41152c..086567f 100644 --- a/tests/packerlicious/test_post_processor_manifest.py +++ b/tests/packerlicious/test_post_processor_manifest.py @@ -1,4 +1,6 @@ import packerlicious.post_processor as post_processor +from packerlicious.template import Template +import json class TestManifestPostProcessor(object): @@ -7,3 +9,30 @@ def test_no_required_fields(self): b = post_processor.Manifest() b.to_dict() + + def test_custom_data(self): + expected_json = """ + { + "post-processors": [ + { + "type": "manifest", + "output": "manifest.json", + "strip_path": "true", + "custom_data": { + "my_custom_data": "example" + } + } + ] + } + """ + p = post_processor.Manifest( + output="manifest.json", + strip_path=True, + custom_data={'my_custom_data': 'example'} + ) + t = Template() + t.add_post_processor(p) + + to_json = t.to_json() + assert to_json == json.dumps(json.loads(expected_json), sort_keys=True, indent=2, + separators=(',', ': '))