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

« back to all changes in this revision

Viewing changes to test/test_framework/tests.py

  • Committer: dilshan_a
  • Date: 2008-01-24 22:16:41 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:289
Updated tests so it works in the test framework

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/')
4
 
 
5
 
from parse_exercise import *
6
 
 
 
3
sys.path.append('../../www/apps/tutorial/test/')
 
4
 
 
5
from parse_tute import *
 
6
 
 
7
def str_exception(test_exception_obj):
 
8
    string = ""
 
9
    
7
10
def print_results(problem):
8
11
    print "Problem: %s" %problem['name']
9
12
    if 'critical_error' in problem:
22
25
                    else:
23
26
                        print "  Failed: %s -- %s" %(part['description'],part['error_message'])
24
27
    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()))
 
28
 
 
29
problem_suite = parse_tutorial_file('hello_text.xml')
 
30
print_results(problem_suite.run_tests("hello.py"))
 
31
 
 
32
problem_suite = parse_tutorial_file('all_input_text.xml')
 
33
print_results(problem_suite.run_tests("all_input.py"))
 
34
 
 
35
problem_suite = parse_tutorial_file('fib_text.xml')
 
36
print_results(problem_suite.run_tests("fib.py"))