From cd58b8f532e7d0337b250e60f5d3d5b073f0479c Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Wed, 13 Nov 2002 19:34:26 +0000 Subject: Add getstate and setstate implementation to concrete set classes. --- Lib/test/test_sets.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Lib/test/test_sets.py') diff --git a/Lib/test/test_sets.py b/Lib/test/test_sets.py index 4521335c51..cf0cd59dc9 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): -- cgit v1.2.1