From e70380e003ae28822a6b903193c9a699cc02c405 Mon Sep 17 00:00:00 2001 From: ipknHama Date: Thu, 7 Aug 2014 04:46:28 +0900 Subject: cmake update, added template test --- tests/template/test.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'tests/template/test.py') diff --git a/tests/template/test.py b/tests/template/test.py index 22fcca0..57bcaf8 100755 --- a/tests/template/test.py +++ b/tests/template/test.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +from __future__ import print_function import glob import json import os @@ -14,15 +15,15 @@ for testfile in glob.glob("*.json"): open('partials', 'w').write(json.dumps(test["partials"])) else: open('partials', 'w').write("{}") - ret = subprocess.check_output("./mustachetest") - print testfile, test["name"] + ret = subprocess.check_output("./mustachetest").decode('utf8') + print(testfile, test["name"]) if ret != test["expected"]: if 'partials' in test: - print 'partials:', json.dumps(test["partials"]) - print json.dumps(test["data"]) - print test["template"] - print 'Expected:',repr(test["expected"]) - print 'Actual:',repr(ret) + print('partials:', json.dumps(test["partials"])) + print(json.dumps(test["data"])) + print(test["template"]) + print('Expected:',repr(test["expected"])) + print('Actual:',repr(ret)) assert ret == test["expected"] os.unlink('data') os.unlink('template') -- cgit v1.2.3-54-g00ecf