summaryrefslogtreecommitdiff
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2005-01-23 09:19:22 +0000
committerMartin v. Löwis <martin@v.loewis.de>2005-01-23 09:19:22 +0000
commit4d394dfebbcf00e7eec74ee5f4c1b149b3744a91 (patch)
treed64b9e915baa44448f28c7da48e38884367a48a9 /Lib/test/test_os.py
parent1083c248dfc55dde9901919e69bcb7fb29fbb7bf (diff)
downloadcpython-git-4d394dfebbcf00e7eec74ee5f4c1b149b3744a91.tar.gz
Truncate st_?time before comparing it with ST_?TIME in the tests.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py6
1 files changed, 5 insertions, 1 deletions
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)