summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-02-11 22:43:24 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-02-11 22:43:24 (GMT)
commit42f08ac1e303117ea789a8ad2a1326db75f923f8 (patch)
treeee82ccd3ada46a1ee43cded38425bf3a4146b67d /Lib/test
parente7b33db22d52424ac99ff02f102f83d3d953e93b (diff)
downloadcpython-42f08ac1e303117ea789a8ad2a1326db75f923f8.zip
cpython-42f08ac1e303117ea789a8ad2a1326db75f923f8.tar.gz
cpython-42f08ac1e303117ea789a8ad2a1326db75f923f8.tar.bz2
Implemented batching for dicts in cPickle. This is after two failed
attempts to merge the C list-batch and dict-batch code -- they worked, but it was a godawful mess to read.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/pickletester.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 6ed29b1..734f2a3 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -694,23 +694,6 @@ class AbstractPickleTests(unittest.TestCase):
else:
self.failUnless(num_appends >= 2)
-# 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)
-
def test_dict_chunking(self):
n = 10 # too small to chunk
x = dict.fromkeys(range(n))
@@ -733,6 +716,23 @@ class TempAbstractPickleTests(unittest.TestCase):
else:
self.failUnless(num_setitems >= 2)
+# 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)
+
class MyInt(int):
sample = 1