import time

time.altzone
time.clock()
t = time.time()
time.asctime(time.gmtime(t))
if time.ctime(t) != time.asctime(time.localtime(t)):
    print 'time.ctime(t) != time.asctime(time.localtime(t))'

time.daylight
if long(time.mktime(time.localtime(t))) != long(t):
    print 'time.mktime(time.localtime(t)) != t'

time.sleep(1.2)
tt = time.gmtime(t)
for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
                  'j', 'm', 'M', 'p', 'S',
                  'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'):
    format = ' %' + directive
    try:
        time.strftime(format, tt)
    except ValueError:
        print 'conversion specifier:', format, ' failed.'

time.timezone
time.tzname

# expected errors
try:
    time.asctime(0)
except TypeError:
    pass

try:
    time.mktime((999999, 999999, 999999, 999999,
                 999999, 999999, 999999, 999999,
                 999999))
except OverflowError:
    pass

@@ -5,330 +5,635 @@
 rt t
-ime%0A%0Atime.altzone%0Atime.clock()%0At = time.time()%0Atime.asctime(time.gmtime(t))%0Aif
+est_support%0Aimport time%0Aimport unittest%0A%0A%0Aclass TimeTestCase(unittest.TestCase):%0A%0A    def setUp(self):%0A        self.t = time.time()%0A%0A    def test_data_attributes(self):%0A        time.altzone%0A        time.daylight%0A       
  time.
-c
 time
-(t) != time.asctime(
+zone%0A        time.tzname%0A%0A    def test_clock(self):%0A        
 time.
+c
 loc
-altime(t)):%0A    print 'time.ctime(t) != time.asctime(time.localtime(t))'%0A%0Atime.daylight%0Aif long(time.mktime(time.localtime(t))) != long(t):%0A    print 'time.mktime(time.localtime(t)) != t'%0A%0Atime.sleep(1.2)%0A
+k()%0A%0A    def test_conversions(self):%0A        self.assert_(time.ctime(self.t)%0A                     == time.asctime(time.localtime(self.t)))%0A        self.assert_(long(time.mktime(time.localtime(self.t)))%0A                     == long(self.t))%0A%0A    def test_sleep(self):%0A        time.sleep(1.2)%0A%0A    def test_strftime(self):%0A        
 tt =
@@ -645,19 +645,32 @@
 .gmtime(
-t)%0A
+self.t)%0A        
 for dire
@@ -737,16 +737,24 @@
         
+        
 'j', 'm'
@@ -788,16 +788,24 @@
         
+        
 'U', 'w'
@@ -842,16 +842,24 @@
 , '%25'):%0A
+        
     form
@@ -888,21 +888,34 @@
     
-try:%0A
+        try:%0A     
         
 time
@@ -906,24 +906,27 @@
             
+   
 time.strftim
@@ -939,16 +939,24 @@
 at, tt)%0A
+        
     exce
@@ -982,14 +982,26 @@
     
-print 
+        self.fail(
 'con
@@ -1022,84 +1022,138 @@
 ier:
-', format, ' failed.'%0A%0A
+ %25r failed.' %25 format)%0A%0A    def test_asctime(self):%0A        
 time.
+asc
 time
-zone%0Atime.tzname%0A%0A# expected errors%0Atry:%0A   
+(time.gmtime(self.t))%0A        self.assertRaises(TypeError,
  tim
@@ -1165,45 +1165,104 @@
 time
-(0)%0Aexcept TypeError:%0A    pass%0A%0Atry:%0A
+, 0)%0A%0A    def test_mktime(self):%0A        self.assertRaises(OverflowError,%0A                      
     
@@ -1272,17 +1272,18 @@
 e.mktime
-(
+, 
 (999999,
@@ -1299,32 +1299,55 @@
 999999, 999999,%0A
+                       
                 
@@ -1400,44 +1400,78 @@
     
-999999))%0Aexcept OverflowError:%0A    pass
+                       999999))%0A%0A%0Atest_support.run_unittest(TimeTestCase)
 %0A

Convert time module tests to PyUnit.