Truncate st_?time before comparing it with ST_?TIME in the tests.

This commit is contained in:
Martin v. Löwis 2005-01-23 09:19:22 +00:00
parent 1083c248df
commit 4d394dfebb
3 changed files with 9 additions and 1 deletions

View file

@ -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)