PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Python | 12 lines | 9 code | 3 blank | 0 comment | 2 complexity | 82ff0f1857483e3541d93af7b7fe4514 MD5 | raw file
 1from types_directive import *
 2
 3d1 = Time1(2001, 2, 3, 60)
 4newDate = add(d1, 7) # check that a Time1 instance is accepted where Date is expected
 5if newDate.day != 10:
 6  raise RuntimeError
 7
 8d2 = Time2(1999, 8, 7, 60)
 9newDate = add(d2, 7) # check that a Time2 instance is accepted where Date is expected
10if newDate.day != 14:
11  raise RuntimeError
12