]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport my checkin of
authorMichael W. Hudson <mwh@python.net>
Thu, 7 Mar 2002 10:12:38 +0000 (10:12 +0000)
committerMichael W. Hudson <mwh@python.net>
Thu, 7 Mar 2002 10:12:38 +0000 (10:12 +0000)
    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.

Lib/test/pickletester.py

index e2d2580b8e5d0257fdd56b77629f503bab26b288..e16428fa33a7a62f941535e536ed99fda5c3b33e 100644 (file)
@@ -254,6 +254,17 @@ class AbstractPickleTests(unittest.TestCase):
         s = self.dumps(t)
         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):