home *** CD-ROM | disk | FTP | other *** search
/ Freelog 33 / Freelog033.iso / Progr / Python-2.2.1.exe / TEST_COPY_REG.PY < prev    next >
Encoding:
Python Source  |  2001-09-20  |  683 b   |  31 lines

  1. import copy_reg
  2. import test_support
  3. import unittest
  4.  
  5.  
  6. class C:
  7.     pass
  8.  
  9.  
  10. class CopyRegTestCase(unittest.TestCase):
  11.  
  12.     def test_class(self):
  13.         self.assertRaises(TypeError, copy_reg.pickle,
  14.                           C, None, None)
  15.  
  16.     def test_noncallable_reduce(self):
  17.         self.assertRaises(TypeError, copy_reg.pickle,
  18.                           type(1), "not a callable")
  19.  
  20.     def test_noncallable_constructor(self):
  21.         self.assertRaises(TypeError, copy_reg.pickle,
  22.                           type(1), int, "not a callable")
  23.  
  24.  
  25. def test_main():
  26.     test_support.run_unittest(CopyRegTestCase)
  27.  
  28.  
  29. if __name__ == "__main__":
  30.     test_main()
  31.