blob: 0f5c96f10dfd5bddd16510544ca6e707b31b1e99 [file] [log] [blame]
Fred Drakecb953d72000-10-11 22:17:35 +00001import copy_reg
Fred Drake5379d052001-05-22 20:38:44 +00002import test_support
3import unittest
4
Fred Drakecb953d72000-10-11 22:17:35 +00005
6class C:
7 pass
8
9
Fred Drake5379d052001-05-22 20:38:44 +000010class 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")
Fred Drakecb953d72000-10-11 22:17:35 +000023
24
Fred Drake2e2be372001-09-20 21:33:42 +000025def test_main():
26 test_support.run_unittest(CopyRegTestCase)
27
28
29if __name__ == "__main__":
30 test_main()