annotate Lib/test/test_time.py @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents 9cefd04ee53a
children 44b8cfbda441
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4612
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
1 import time
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
2
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
3 time.altzone
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
4 time.clock()
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
5 t = time.time()
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
6 time.asctime(time.gmtime(t))
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
7 if time.ctime(t) <> time.asctime(time.localtime(t)):
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
8 print 'time.ctime(t) <> time.asctime(time.localtime(t))'
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
9
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
10 time.daylight
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
11 if int(time.mktime(time.localtime(t))) <> int(t):
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
12 print 'time.mktime(time.localtime(t)) <> t'
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
13
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
14 time.sleep(1.2)
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
15 tt = time.gmtime(t)
5146
9cefd04ee53a Removed nonstandard strftime formats (strftime is tested more
Guido van Rossum <guido@python.org>
parents: 4612
diff changeset
16 for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
9cefd04ee53a Removed nonstandard strftime formats (strftime is tested more
Guido van Rossum <guido@python.org>
parents: 4612
diff changeset
17 'j', 'm', 'M', 'p', 'S',
4612
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
18 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'):
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
19 format = '%' + directive
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
20 time.strftime(format, tt)
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
21
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
22 time.timezone
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
23 time.tzname
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
24
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
25 # expected errors
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
26 try:
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
27 time.asctime(0)
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
28 except TypeError:
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
29 pass
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
30
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
31 try:
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
32 time.mktime((999999, 999999, 999999, 999999,
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
33 999999, 999999, 999999, 999999,
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
34 999999))
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
35 except OverflowError:
4de05cbf5ad1 test of time module. not terribly fancy, but it does touch every
Barry Warsaw <barry@python.org>
parents:
diff changeset
36 pass