From 4d394dfebbcf00e7eec74ee5f4c1b149b3744a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sun, 23 Jan 2005 09:19:22 +0000 Subject: Truncate st_?time before comparing it with ST_?TIME in the tests. --- Lib/test/test_os.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Lib/test/test_os.py') diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 25fad18a2a..472d13fd09 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -111,7 +111,11 @@ class StatAttributeTests(unittest.TestCase): 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) -- cgit v1.2.1