PageRenderTime 47ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Python | 64 lines | 48 code | 16 blank | 0 comment | 16 complexity | 55ca6dc86fca50aea05983008ebb0afc MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. import default_args
  2. if default_args.Statics_staticMethod() != 60:
  3. raise RuntimeError
  4. if default_args.cfunc1(1) != 2:
  5. raise RuntimeError
  6. if default_args.cfunc2(1) != 3:
  7. raise RuntimeError
  8. if default_args.cfunc3(1) != 4:
  9. raise RuntimeError
  10. f = default_args.Foo()
  11. f.newname()
  12. f.newname(1)
  13. try:
  14. f = default_args.Foo(1)
  15. error = 1
  16. except:
  17. error = 0
  18. if error: raise RuntimeError,"Foo::Foo ignore is not working"
  19. try:
  20. f = default_args.Foo(1,2)
  21. error = 1
  22. except:
  23. error = 0
  24. if error: raise RuntimeError,"Foo::Foo ignore is not working"
  25. try:
  26. f = default_args.Foo(1,2,3)
  27. error = 1
  28. except:
  29. error = 0
  30. if error: raise RuntimeError,"Foo::Foo ignore is not working"
  31. try:
  32. m = f.meth(1)
  33. error = 1
  34. except:
  35. error = 0
  36. if error: raise RuntimeError,"Foo::meth ignore is not working"
  37. try:
  38. m = f.meth(1,2)
  39. error = 1
  40. except:
  41. error = 0
  42. if error: raise RuntimeError,"Foo::meth ignore is not working"
  43. try:
  44. m = f.meth(1,2,3)
  45. error = 1
  46. except:
  47. error = 0
  48. if error: raise RuntimeError,"Foo::meth ignore is not working"