[Python-checkins] CVS: python/dist/src/Lib/test pickletester.py,1.12.4.1,1.12.4.2
Michael Hudson
mwh@users.sourceforge.net
Thu, 07 Mar 2002 02:12:40 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv21239
Modified Files:
Tag: release22-maint
pickletester.py
Log Message:
backport my checkin of
revision 1.14 of pickletester.py
Special support for pickling os.stat and os.stat_vfs results portably
(the types come from different modules on different platforms).
Added tests for pickling these types.
May be a bugfix candidate.
Index: pickletester.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/pickletester.py,v
retrieving revision 1.12.4.1
retrieving revision 1.12.4.2
diff -C2 -d -r1.12.4.1 -r1.12.4.2
*** pickletester.py 5 Mar 2002 14:01:28 -0000 1.12.4.1
--- pickletester.py 7 Mar 2002 10:12:38 -0000 1.12.4.2
***************
*** 255,258 ****
--- 255,269 ----
u = self.loads(s)
self.assertEqual(t, u)
+ import os
+ if hasattr(os, "stat"):
+ t = os.stat(os.curdir)
+ s = self.dumps(t)
+ u = self.loads(s)
+ self.assertEqual(t, u)
+ if hasattr(os, "statvfs"):
+ t = os.statvfs(os.curdir)
+ s = self.dumps(t)
+ u = self.loads(s)
+ self.assertEqual(t, u)
class AbstractPickleModuleTests(unittest.TestCase):