mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
27 lines
835 B
Python
27 lines
835 B
Python
|
#!/usr/bin/env python
|
||
|
import glob
|
||
|
import json
|
||
|
import os
|
||
|
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"]
|
||
|
open('data', 'w').write(json.dumps(test["data"]))
|
||
|
open('template', 'w').write(test["template"])
|
||
|
ret = subprocess.check_output("./mustachetest")
|
||
|
if ret != test["expected"]:
|
||
|
print 'Expected:',(test["expected"])
|
||
|
print 'Actual:',(ret)
|
||
|
os.unlink('data')
|
||
|
os.unlink('template')
|
||
|
assert ret == test["expected"]
|