[Python-checkins] python/dist/src/Lib/test test_sets.py,1.15,1.16

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Wed, 13 Nov 2002 11:34:29 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv7523/test

Modified Files:
	test_sets.py 
Log Message:
Add getstate and setstate implementation to concrete set classes.







Index: test_sets.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sets.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** test_sets.py	9 Nov 2002 05:26:15 -0000	1.15
--- test_sets.py	13 Nov 2002 19:34:26 -0000	1.16
***************
*** 1,5 ****
  #!/usr/bin/env python
  
! import unittest, operator, copy
  from sets import Set, ImmutableSet
  from test import test_support
--- 1,5 ----
  #!/usr/bin/env python
  
! import unittest, operator, copy, pickle
  from sets import Set, ImmutableSet
  from test import test_support
***************
*** 74,77 ****
--- 74,85 ----
          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))
  
  #------------------------------------------------------------------------------