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

« back to all changes in this revision

Viewing changes to test/test_framework/tests.py

  • Committer: mattgiuca
  • Date: 2008-01-24 23:31:45 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:291
tutorial: Added code to handle top-level menu and subject menu (reads dir
    listing, XML files, and presents a list of links).
    Added code to handle a worksheet page. Presents the page as HTML,
    observing <problem> elements and reading in their XML files.
    Currently does not handle problems; just prints out their source files.
Added media/tutorial/tutorial.css (very minimal currently).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
import sys
3
 
sys.path.append('../../www/apps/tutorialservice/test/')
 
3
sys.path.append('../../www/apps/tutorial/test/')
4
4
 
5
 
from parse_exercise import *
 
5
from parse_tute import *
6
6
 
7
7
def print_results(problem):
8
8
    print "Problem: %s" %problem['name']
22
22
                    else:
23
23
                        print "  Failed: %s -- %s" %(part['description'],part['error_message'])
24
24
    print
25
 
    
26
 
problem_suite = parse_exercise_file('filesum_text.xml')
27
 
print_results(problem_suite.run_tests(file("filesum.py").read()))
28
 
 
29
 
problem_suite = parse_exercise_file('hello_text.xml')
30
 
print_results(problem_suite.run_tests(file("hello.py").read()))
31
 
 
32
 
problem_suite = parse_exercise_file('all_input_text.xml')
33
 
print_results(problem_suite.run_tests(file("all_input.py").read()))
34
 
 
35
 
problem_suite = parse_exercise_file('fib_text.xml')
36
 
print_results(problem_suite.run_tests(file("fib.py").read()))
 
25
 
 
26
problem_suite = parse_tutorial_file('hello_text.xml')
 
27
print_results(problem_suite.run_tests("hello.py"))
 
28
 
 
29
problem_suite = parse_tutorial_file('all_input_text.xml')
 
30
print_results(problem_suite.run_tests("all_input.py"))
 
31
 
 
32
problem_suite = parse_tutorial_file('fib_text.xml')
 
33
print_results(problem_suite.run_tests("fib.py"))