~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to test/test_framework/test_json.py

  • Committer: mattgiuca
  • Date: 2008-01-24 21:29:34 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:286
test_framework: Added test_json, a version of test.py which outputs JSON
    instead of a simple printing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import cjson
 
2
import sys
 
3
sys.path.append('../../www/apps/tutorial/test/')
 
4
 
 
5
from parse_tute import *
 
6
 
 
7
for i in range(1, len(sys.argv)):
 
8
    basename = sys.argv[i]
 
9
    xmlfile = basename + '_text.xml'
 
10
    pyfile = basename + '.py'
 
11
    jobj = {"problem": basename}
 
12
 
 
13
    problem_suite = parse_tutorial_file(xmlfile)
 
14
    jobj['name'], results = problem_suite.run_tests(pyfile)
 
15
    jobj['cases'] = results
 
16
 
 
17
    print cjson.encode(jobj)