summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sets.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2002-11-13 19:34:26 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2002-11-13 19:34:26 (GMT)
commitcd58b8f532e7d0337b250e60f5d3d5b073f0479c (patch)
tree555d5d08b73436097ae4894b18efae94fdc03c63 /Lib/test/test_sets.py
parent66abcee948e9183edd807f8c0ce3c2a721cdafd0 (diff)
downloadcpython-cd58b8f532e7d0337b250e60f5d3d5b073f0479c.zip
cpython-cd58b8f532e7d0337b250e60f5d3d5b073f0479c.tar.gz
cpython-cd58b8f532e7d0337b250e60f5d3d5b073f0479c.tar.bz2
Add getstate and setstate implementation to concrete set classes.
Diffstat (limited to 'Lib/test/test_sets.py')
-rw-r--r--Lib/test/test_sets.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_sets.py b/Lib/test/test_sets.py
index 4521335..cf0cd59 100644
--- a/Lib/test/test_sets.py
+++ b/Lib/test/test_sets.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-import unittest, operator, copy
+import unittest, operator, copy, pickle
from sets import Set, ImmutableSet
from test import test_support
@@ -74,6 +74,14 @@ class TestBasicOps(unittest.TestCase):
for v in self.set:
self.assert_(v in self.values)
+ def test_pickling(self):
+ p = pickle.dumps(self.set)
+ print repr(p)
+ copy = pickle.loads(p)
+ repr(copy)
+ self.assertEqual(self.set, copy,
+ "%s != %s" % (self.set, copy))
+
#------------------------------------------------------------------------------
class TestBasicOpsEmpty(TestBasicOps):