# Path: poni/template.py
#     def _patched_convertTmplPathToModuleName(tmplPath):
#     def _patched_genUniqueModuleName(baseModuleName):
# def render_name(source_text, source_path, variables):
#     def sub(match):
# def render_cheetah(source_text, source_path, variables):
# def render_mako(source_text, source_path, variables):
# def render_genshi(source_text, source_path, variables):
# def render(engine=None, source_text=None, source_path=None, variables=None):
# 
# Path: poni/tool.py
# TOOL_NAME = "poni"
# def arg_flag(*args, **kwargs):
# def arg_target_nodes_0_to_n(method):
# def arg_target_nodes(method):
#     def __init__(self, op, args, verbose=False, method=None, quiet=False,
#                  output_dir=None, color="auto"):
#     def __repr__(self):
#     def send_output(self, msg):
#     def can_start(self):
#     def check_dependencies(self):
#     def execute(self):
#     def __init__(self, default_repo_path=None):
#     def reset_cache(self):
#     def handle_add_system(self, arg):
#     def handle_version(self, arg):
#     def handle_require(self, arg):
#     def handle_init(self, arg):
#     def handle_import(self, arg):
#     def preprocess_script_lines(self, lines):
#     def handle_script(self, arg):
#         def wrap(args):
#         def set_repo_path(sub_arg):
#     def handle_update_config(self, arg):
#     def handle_remove_config(self, arg):
#     def handle_add_config(self, arg):
#     def handle_add_library(self, arg):
#     def handle_control(self, arg):
#         def add_all_required_ops(op):
#     def handle_remote_exec(self, arg):
#         def rexec(arg, node, remote):
#     def handle_remote_cp(self, arg):
#         def pp(pth):
#         def copy_file_or_dir(node, remote, source_path, dest_dir):
#         def copy_op(arg, node, remote):
#     def handle_remote_shell(self, arg):
#         def rshell(arg, node, remote):
#     def remote_op(self, confman, arg, op, exclude=None):
#     def handle_vc_init(self, arg):
#     def require_vc(self, confman):
#     def handle_vc_diff(self, arg):
#     def handle_vc_checkpoint(self, arg):
#     def handle_cloud_terminate(self, arg):
#     def handle_cloud_update(self, arg):
#     def handle_cloud_wait(self, arg):
#     def handle_cloud_init(self, arg):
#     def handle_cloud_ip(self, arg):
#     def cloud_op(self, confman, arg, start):
#         def printable(dict_obj):
#     def _get_cloud_hosts_from_args(self, arg):
#     def handle_cloud_create_snapshot(self, arg):
#     def handle_cloud_revert_to_snapshot(self, arg):
#     def handle_cloud_remove_snapshot(self, arg):
#     def handle_cloud_power_off(self, arg):
#     def handle_cloud_power_on(self, arg):
#     def handle_set(self, arg):
#     def collect_all(self, manager):
#     def verify_op(self, confman, target, full_match=False, exclude=None,
#                   **verify_options):
#             def target_filter(item):
#     def handle_show(self, arg):
#     def handle_report(self, arg):
#     def handle_deploy(self, arg):
#     def handle_audit(self, arg):
#     def handle_verify(self, arg):
#     def handle_add_node(self, arg):
#     def handle_list(self, arg):
#     def get_confman(self, root_dir, must_exist=True, reset_cache=True):
#     def get_manager(self, confman):
#     def handle_settings_list(self, arg):
#     def handle_settings_set(self, arg):
#     def create_parser(self):
#     def tune_arg_namespace(self, arg):
#     def run(self, args=None):
#         def adjust_logging(arg):
#     def execute(self, args):
#     def main(self):
#     def run_exit(cls):
# class ControlTask(work.Task):
# class Tool(object):


from pytest import skip
from poni import template
from poni import tool
from helper import *
import os

        # deploy and verify
        assert not poni.run(["deploy"])
        with open(output_file, "r") as f:
            output = f.read()
        print(output)
        assert "<foo>baz</foo>" in output

    name_tests = {
        "foo": "foo",
        "foo [$text]": "foo [dummy text variable]",
        "foo ${dict.key}bar": "foo dummy value in a dictbar",
        "foo \\${dict.key}bar": "foo ${dict.key}bar",
        "foo \\$1": "foo $1",
        "foo \\\\$object.val1": "foo \\$object.val1",
        "foo \\$object.val1": "foo $object.val1",
        "foo $object.val1": "foo object variable 1",
        "$object.val2.key: x": "dict in object variable 2: x",
        }

    def test_render_name(self):
        for tmpl, exp in self.name_tests.items():
            res = template.render_name(tmpl, None, g_vars)
            assert exp == res, \
                "template {0!r}, expected {1!r}, got {2!r}".format(tmpl, exp, res)

    def test_render_cheetah(self):
        if not template.CheetahTemplate:
            skip("CheetahTemplate not available")
        for tmpl, exp in self.name_tests.items():

# Path: poni/template.py
#     def _patched_convertTmplPathToModuleName(tmplPath):
#     def _patched_genUniqueModuleName(baseModuleName):
# def render_name(source_text, source_path, variables):
#     def sub(match):
# def render_cheetah(source_text, source_path, variables):
# def render_mako(source_text, source_path, variables):
# def render_genshi(source_text, source_path, variables):
# def render(engine=None, source_text=None, source_path=None, variables=None):
# 
# Path: poni/tool.py
# TOOL_NAME = "poni"
# def arg_flag(*args, **kwargs):
# def arg_target_nodes_0_to_n(method):
# def arg_target_nodes(method):
#     def __init__(self, op, args, verbose=False, method=None, quiet=False,
#                  output_dir=None, color="auto"):
#     def __repr__(self):
#     def send_output(self, msg):
#     def can_start(self):
#     def check_dependencies(self):
#     def execute(self):
#     def __init__(self, default_repo_path=None):
#     def reset_cache(self):
#     def handle_add_system(self, arg):
#     def handle_version(self, arg):
#     def handle_require(self, arg):
#     def handle_init(self, arg):
#     def handle_import(self, arg):
#     def preprocess_script_lines(self, lines):
#     def handle_script(self, arg):
#         def wrap(args):
#         def set_repo_path(sub_arg):
#     def handle_update_config(self, arg):
#     def handle_remove_config(self, arg):
#     def handle_add_config(self, arg):
#     def handle_add_library(self, arg):
#     def handle_control(self, arg):
#         def add_all_required_ops(op):
#     def handle_remote_exec(self, arg):
#         def rexec(arg, node, remote):
#     def handle_remote_cp(self, arg):
#         def pp(pth):
#         def copy_file_or_dir(node, remote, source_path, dest_dir):
#         def copy_op(arg, node, remote):
#     def handle_remote_shell(self, arg):
#         def rshell(arg, node, remote):
#     def remote_op(self, confman, arg, op, exclude=None):
#     def handle_vc_init(self, arg):
#     def require_vc(self, confman):
#     def handle_vc_diff(self, arg):
#     def handle_vc_checkpoint(self, arg):
#     def handle_cloud_terminate(self, arg):
#     def handle_cloud_update(self, arg):
#     def handle_cloud_wait(self, arg):
#     def handle_cloud_init(self, arg):
#     def handle_cloud_ip(self, arg):
#     def cloud_op(self, confman, arg, start):
#         def printable(dict_obj):
#     def _get_cloud_hosts_from_args(self, arg):
#     def handle_cloud_create_snapshot(self, arg):
#     def handle_cloud_revert_to_snapshot(self, arg):
#     def handle_cloud_remove_snapshot(self, arg):
#     def handle_cloud_power_off(self, arg):
#     def handle_cloud_power_on(self, arg):
#     def handle_set(self, arg):
#     def collect_all(self, manager):
#     def verify_op(self, confman, target, full_match=False, exclude=None,
#                   **verify_options):
#             def target_filter(item):
#     def handle_show(self, arg):
#     def handle_report(self, arg):
#     def handle_deploy(self, arg):
#     def handle_audit(self, arg):
#     def handle_verify(self, arg):
#     def handle_add_node(self, arg):
#     def handle_list(self, arg):
#     def get_confman(self, root_dir, must_exist=True, reset_cache=True):
#     def get_manager(self, confman):
#     def handle_settings_list(self, arg):
#     def handle_settings_set(self, arg):
#     def create_parser(self):
#     def tune_arg_namespace(self, arg):
#     def run(self, args=None):
#         def adjust_logging(arg):
#     def execute(self, args):
#     def main(self):
#     def run_exit(cls):
# class ControlTask(work.Task):
# class Tool(object):


# Path: tests/test_templates.py
from pytest import skip
from poni import template
from poni import tool
from helper import *
import os


        # deploy and verify
        assert not poni.run(["deploy"])
        with open(output_file, "r") as f:
            output = f.read()
        print(output)
        assert "<foo>baz</foo>" in output

    name_tests = {
        "foo": "foo",
        "foo [$text]": "foo [dummy text variable]",
        "foo ${dict.key}bar": "foo dummy value in a dictbar",
        "foo \\${dict.key}bar": "foo ${dict.key}bar",
        "foo \\$1": "foo $1",
        "foo \\\\$object.val1": "foo \\$object.val1",
        "foo \\$object.val1": "foo $object.val1",
        "foo $object.val1": "foo object variable 1",
        "$object.val2.key: x": "dict in object variable 2: x",
        }

    def test_render_name(self):
        for tmpl, exp in self.name_tests.items():
            res = template.render_name(tmpl, None, g_vars)
            assert exp == res, \
                "template {0!r}, expected {1!r}, got {2!r}".format(tmpl, exp, res)

    def test_render_cheetah(self):
        if not template.CheetahTemplate:
            skip("CheetahTemplate not available")
        for tmpl, exp in self.name_tests.items():

            res = template.render_cheetah(tmpl, None, g_vars)