'Template errors result in the process exiting and an error message
printed to stderr.
Packer prints machine-readable output to stderr and
``publish-installer-images`` echos those lines to its stderr as well as
parsing the output.'

@require_packer
def test_template_error(self):

    sys_module = FakeSysModule()
    self.addCleanup((lambda : self.addDetail(name='stderr', content_object=text_content(sys_module.stderr.getvalue()))))
    configuration_path = self.make_temporary_file(content='')
    d = async_perform(dispatcher=RealPerformers(sys_module=sys_module).dispatcher(), effect=Effect(intent=PackerBuild(configuration_path=configuration_path)))
    d = self.assertFailure(d, ProcessTerminated)
    def check_error(exception):
        self.assertEqual(1, exception.exitCode)
        self.assertIn('Failed    to    parse    template', sys_module.stderr.getvalue())
    return d.addCallback(check_error)
