PageRenderTime 18ms CodeModel.GetById 1ms app.highlight 11ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/test-suite/python/default_args_runme.py

#
Python | 64 lines | 48 code | 16 blank | 0 comment | 10 complexity | 55ca6dc86fca50aea05983008ebb0afc MD5 | raw file
 1import default_args 
 2
 3
 4if default_args.Statics_staticMethod() != 60:
 5  raise RuntimeError
 6  
 7if default_args.cfunc1(1) != 2:
 8  raise RuntimeError
 9
10if default_args.cfunc2(1) != 3:
11  raise RuntimeError
12
13if default_args.cfunc3(1) != 4:
14  raise RuntimeError
15
16
17f = default_args.Foo()
18
19f.newname()
20f.newname(1)
21
22
23try:
24  f = default_args.Foo(1)
25  error = 1
26except:
27  error = 0
28if error:  raise RuntimeError,"Foo::Foo ignore is not working"
29
30try:
31  f = default_args.Foo(1,2)
32  error = 1
33except:
34  error = 0
35if error:  raise RuntimeError,"Foo::Foo ignore is not working"
36
37try:
38  f = default_args.Foo(1,2,3)
39  error = 1
40except:
41  error = 0
42if error:  raise RuntimeError,"Foo::Foo ignore is not working"
43
44try:
45  m = f.meth(1)
46  error = 1
47except:
48  error = 0
49if error:  raise RuntimeError,"Foo::meth ignore is not working"
50
51try:
52  m = f.meth(1,2)
53  error = 1
54except:
55  error = 0
56if error:  raise RuntimeError,"Foo::meth ignore is not working"
57
58try:
59  m = f.meth(1,2,3)
60  error = 1
61except:
62  error = 0
63if error:  raise RuntimeError,"Foo::meth ignore is not working"
64