summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-01-28 04:14:51 (GMT)
committerGuido van Rossum <guido@python.org>2003-01-28 04:14:51 (GMT)
commit44f0ea5f73a6579172ccb661fff3cca47fa4005b (patch)
tree4faafb85328e827e097b6ca7bbe3b4f9c00b7b49 /Lib/test/pickletester.py
parent9d32bb170883dfbeec87e59135a102f93c97fcaf (diff)
downloadcpython-44f0ea5f73a6579172ccb661fff3cca47fa4005b.zip
cpython-44f0ea5f73a6579172ccb661fff3cca47fa4005b.tar.gz
cpython-44f0ea5f73a6579172ccb661fff3cca47fa4005b.tar.bz2
More protocol 2: TUPLE1, TUPLE2, TUPLE3.
Also moved the special case for empty tuples from save() to save_tuple().
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 85887ea..e37a7b0 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -281,6 +281,18 @@ class AbstractPickleTests(unittest.TestCase):
y = self.loads(s)
self.assertEqual(x, y)
+ def test_short_tuples(self):
+ a = ()
+ b = (12,)
+ c = (6, 6)
+ d = (4, 4, 4)
+ e = (3, 3, 3, 3)
+ for proto in 0, 1, 2:
+ for x in a, b, c, d, e:
+ s = self.dumps(x, proto)
+ y = self.loads(s)
+ self.assertEqual(x, y, (proto, x, s, y))
+
class AbstractPickleModuleTests(unittest.TestCase):
def test_dump_closed_file(self):