Lines Matching refs:copyreg

1 import copyreg
35 self.assertRaises(TypeError, copyreg.pickle,
39 self.assertRaises(TypeError, copyreg.pickle,
43 self.assertRaises(TypeError, copyreg.pickle,
55 self.assertRaises(ValueError, copyreg.remove_extension,
57 copyreg.add_extension(mod, func, code)
59 self.assertTrue(copyreg._extension_registry[mod, func] == code)
60 self.assertTrue(copyreg._inverted_registry[code] == (mod, func))
62 self.assertNotIn(code, copyreg._extension_cache)
64 copyreg.add_extension(mod, func, code) # shouldn't blow up
66 self.assertRaises(ValueError, copyreg.add_extension,
68 self.assertRaises(ValueError, copyreg.remove_extension,
71 self.assertRaises(ValueError, copyreg.add_extension,
73 self.assertRaises(ValueError, copyreg.remove_extension,
76 self.assertRaises(ValueError, copyreg.add_extension,
78 self.assertRaises(ValueError, copyreg.remove_extension,
81 if code + 1 not in copyreg._inverted_registry:
82 self.assertRaises(ValueError, copyreg.remove_extension,
89 self.assertNotIn((mod, func), copyreg._extension_registry)
98 copyreg.add_extension(mod, func, code)
99 copyreg.remove_extension(mod, func, code)
105 self.assertRaises(ValueError, copyreg.add_extension,
109 self.assertEqual(copyreg._slotnames(WithoutSlots), [])
110 self.assertEqual(copyreg._slotnames(WithWeakref), [])
112 self.assertEqual(copyreg._slotnames(WithPrivate), expected)
114 self.assertEqual(copyreg._slotnames(_WithLeadingUnderscoreAndPrivate),
116 self.assertEqual(copyreg._slotnames(___), ['__spam'])
117 self.assertEqual(copyreg._slotnames(WithSingleString), ['spam'])
120 result = copyreg._slotnames(WithInherited)