[Python-checkins] python/dist/src/Lib/test pickletester.py,1.42,1.43

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
2003年2月04日 12:56:46 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv7825/Lib/test
Modified Files:
	pickletester.py 
Log Message:
cPickle now generates proto 2 EXT[124] when appropriate.
Moved such EXT tests as currently exist from TempAbstractPickleTests to
AbstractPickleTests, so that test_cpickle runs them too.
Index: pickletester.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/pickletester.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** pickletester.py	3 Feb 2003 22:32:18 -0000	1.42
--- pickletester.py	4 Feb 2003 20:56:08 -0000	1.43
***************
*** 584,604 ****
 self.assertEqual(x.__dict__, y.__dict__, detail)
 
- # XXX Temporary hack, so long as the C implementation of pickle protocol
- # XXX 2 isn't ready. When it is, move the methods in TempAbstractPickleTests
- # XXX into AbstractPickleTests above, and get rid of TempAbstractPickleTests
- # XXX along with the references to it in test_pickle.py.
- class TempAbstractPickleTests(unittest.TestCase):
- 
- def test_newobj_list_slots(self):
- x = SlotList([1, 2, 3])
- x.foo = 42
- x.bar = "hello"
- s = self.dumps(x, 2)
- y = self.loads(s)
- self.assertEqual(list(x), list(y))
- self.assertEqual(x.__dict__, y.__dict__)
- self.assertEqual(x.foo, y.foo)
- self.assertEqual(x.bar, y.bar)
- 
 # Register a type with copy_reg, with extension code extcode. Pickle
 # an object of that type. Check that the resulting pickle uses opcode
--- 584,587 ----
***************
*** 639,643 ****
 
 def test_global_ext4(self):
! self.produce_global_ext(0xffffff0, pickle.EXT4)
 
 
--- 622,643 ----
 
 def test_global_ext4(self):
! self.produce_global_ext(0xabcdef0, pickle.EXT4)
! 
! # XXX Temporary hack, so long as the C implementation of pickle protocol
! # XXX 2 isn't ready. When it is, move the methods in TempAbstractPickleTests
! # XXX into AbstractPickleTests above, and get rid of TempAbstractPickleTests
! # XXX along with the references to it in test_pickle.py.
! class TempAbstractPickleTests(unittest.TestCase):
! 
! def test_newobj_list_slots(self):
! x = SlotList([1, 2, 3])
! x.foo = 42
! x.bar = "hello"
! s = self.dumps(x, 2)
! y = self.loads(s)
! self.assertEqual(list(x), list(y))
! self.assertEqual(x.__dict__, y.__dict__)
! self.assertEqual(x.foo, y.foo)
! self.assertEqual(x.bar, y.bar)
 
 

AltStyle によって変換されたページ (->オリジナル) /