Improved some error messages for command line processing.
[python/dscho.git] / Lib / test / test_time.py
blob03d081eb99d3e0b2c11d93c878a468274a446c80
1 import time
3 time.altzone
4 time.clock()
5 t = time.time()
6 time.asctime(time.gmtime(t))
7 if time.ctime(t) <> time.asctime(time.localtime(t)):
8 print 'time.ctime(t) <> time.asctime(time.localtime(t))'
10 time.daylight
11 if long(time.mktime(time.localtime(t))) <> long(t):
12 print 'time.mktime(time.localtime(t)) <> t'
14 time.sleep(1.2)
15 tt = time.gmtime(t)
16 for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
17 'j', 'm', 'M', 'p', 'S',
18 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'):
19 format = ' %' + directive
20 try:
21 time.strftime(format, tt)
22 except ValueError:
23 print 'conversion specifier:', format, ' failed.'
25 time.timezone
26 time.tzname
28 # expected errors
29 try:
30 time.asctime(0)
31 except TypeError:
32 pass
34 try:
35 time.mktime((999999, 999999, 999999, 999999,
36 999999, 999999, 999999, 999999,
37 999999))
38 except OverflowError:
39 pass