def METHOD_NAME(
    self, mock_exists, mock_command, mock_get_template
):
    template = Mock()
    mock_get_template.return_value = template
    template.substitute.side_effect = Exception
    with patch('builtins.open'):
        with raises(KiwiTemplateError):
            self.disk_format.create_image_format()