コード例 #1
0
ファイル: test.py プロジェクト: clach04/Stache
def verify_js(output, template, data):
    if json is None:
        warnings.warn('json module missing, skipping this js test')
        return
    script = render_js(template)
    print("%s with %s" % (template, data))
    result = subprocess.check_output(["node", "-e", "console.log({0}({1}))".format(script,  json.dumps(data))]).strip()
    print("Result: %s\n" % result)
    assert output.lower() == result
コード例 #2
0
ファイル: test.py プロジェクト: clach04/Stache
def bare_js(output, template, data):
    script = render_js(template)