PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Python | 22 lines | 18 code | 3 blank | 1 comment | 8 complexity | 064554951c5c0a3c50f19bee02d81791 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. import overload_extendc
  2. f = overload_extendc.Foo()
  3. if f.test(3) != 1:
  4. raise RuntimeError
  5. if f.test("hello") != 2:
  6. raise RuntimeError
  7. if f.test(3.5,2.5) != 3:
  8. raise RuntimeError
  9. if f.test("hello",20) != 1020:
  10. raise RuntimeError
  11. if f.test("hello",20,100) != 120:
  12. raise RuntimeError
  13. # C default args
  14. if f.test(f) != 30:
  15. raise RuntimeError
  16. if f.test(f,100) != 120:
  17. raise RuntimeError
  18. if f.test(f,100,200) != 300:
  19. raise RuntimeError