[Python-checkins] python/dist/src/Lib/test test_os.py,1.27,1.28

loewis at users.sourceforge.net loewis at users.sourceforge.net
Sun Jan 23 10:19:23 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19682/Lib/test

Modified Files:
	test_os.py 
Log Message:
Truncate st_?time before comparing it with ST_?TIME in the tests.


Index: test_os.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- test_os.py	29 Aug 2004 18:47:31 -0000	1.27
+++ test_os.py	23 Jan 2005 09:19:20 -0000	1.28
@@ -111,7 +111,11 @@
         for name in dir(stat):
             if name[:3] == 'ST_':
                 attr = name.lower()
-                self.assertEquals(getattr(result, attr),
+                if name.endswith("TIME"):
+                    def trunc(x): return int(x)
+                else:
+                    def trunc(x): return x
+                self.assertEquals(trunc(getattr(result, attr)),
                                   result[getattr(stat, name)])
                 self.assert_(attr in members)
 



More information about the Python-checkins mailing list