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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from ctypes import *
  5. import unittest
  6. subclasses = []
  7. for base in [
  8.     c_byte,
  9.     c_short,
  10.     c_int,
  11.     c_long,
  12.     c_longlong,
  13.     c_ubyte,
  14.     c_ushort,
  15.     c_uint,
  16.     c_ulong,
  17.     c_ulonglong,
  18.     c_float,
  19.     c_double,
  20.     c_longdouble,
  21.     c_bool]:
  22.     
  23.     class X(base):
  24.         pass
  25.  
  26.     subclasses.append(X)
  27.  
  28.  
  29. class X(c_char):
  30.     pass
  31.  
  32.  
  33. class ReprTest(unittest.TestCase):
  34.     
  35.     def test_numbers(self):
  36.         for typ in subclasses:
  37.             base = typ.__bases__[0]
  38.             self.failUnless(repr(base(42)).startswith(base.__name__))
  39.             self.failUnlessEqual('<X object at', repr(typ(42))[:12])
  40.         
  41.  
  42.     
  43.     def test_char(self):
  44.         self.failUnlessEqual("c_char('x')", repr(c_char('x')))
  45.         self.failUnlessEqual('<X object at', repr(X('x'))[:12])
  46.  
  47.  
  48. if __name__ == '__main__':
  49.     unittest.main()
  50.  
  51.