home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_2583 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  1.5 KB  |  39 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import unittest
  5. import pywintypes
  6. import time
  7.  
  8. class TestCase(unittest.TestCase):
  9.     
  10.     def testPyTimeFormat(self):
  11.         struct_current = time.localtime()
  12.         pytime_current = pywintypes.Time(struct_current)
  13.         format_string = '%a %A %b %B %c %d %H %I %j %m %M %p %S %U %w %W %x %X %y %Y %Z'
  14.         self.assertEquals(pytime_current.Format(format_string), time.strftime(format_string, struct_current))
  15.  
  16.     
  17.     def testPyTimePrint(self):
  18.         t = pywintypes.Time(-2)
  19.         
  20.         try:
  21.             t.Format()
  22.         except ValueError:
  23.             return None
  24.  
  25.  
  26.     
  27.     def testGUID(self):
  28.         s = '{00020400-0000-0000-C000-000000000046}'
  29.         iid = pywintypes.IID(s)
  30.         iid2 = pywintypes.IID(buffer(iid), True)
  31.         self.assertEquals(iid, iid2)
  32.         self.assertRaises(ValueError, pywintypes.IID, '00', True)
  33.         self.assertRaises(TypeError, pywintypes.IID, 0, True)
  34.  
  35.  
  36. if __name__ == '__main__':
  37.     unittest.main()
  38.  
  39.