aboutsummaryrefslogtreecommitdiffstats
path: root/template_test
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2014-08-02 06:30:36 +0900
committeripknHama <ipknhama@gmail.com>2014-08-02 22:32:49 +0900
commit9d1d65b08c4a4c33923935a5414d6e6f4fe59ceb (patch)
tree4a226094b7840c5bbcbb45ca704b34b91507c3b3 /template_test
parent2963a0a47784a4cc7640719a8323d570c742181d (diff)
downloadcrow-9d1d65b08c4a4c33923935a5414d6e6f4fe59ceb.tar.gz
crow-9d1d65b08c4a4c33923935a5414d6e6f4fe59ceb.zip
implementing mustache specs except partial and lambdas
Diffstat (limited to 'template_test')
-rwxr-xr-xtemplate_test/test.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/template_test/test.py b/template_test/test.py
index b492396..f99ca23 100755
--- a/template_test/test.py
+++ b/template_test/test.py
@@ -6,21 +6,20 @@ import subprocess
for testfile in glob.glob("*.json"):
testdoc = json.load(open(testfile))
for test in testdoc["tests"]:
- if "partials" in test:
- continue
- if "partial" in test:
- continue
if "lambda" in test["data"]:
continue
- print testfile, test["name"]
- print json.dumps(test["data"])
- print test["template"]
+ if "partials" in test:
+ #print testfile, test["name"]
+ continue
open('data', 'w').write(json.dumps(test["data"]))
open('template', 'w').write(test["template"])
ret = subprocess.check_output("./mustachetest")
+ print testfile, test["name"]
if ret != test["expected"]:
- print 'Expected:',(test["expected"])
- print 'Actual:',(ret)
+ 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')
- assert ret == test["expected"]