mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 03:06:33 +00:00
test_dirnode.py: add diag output to test-ctime/mtime tests
This commit is contained in:
parent
622c477e31
commit
b90eaf75da
@ -157,6 +157,9 @@ class Dirnode(unittest.TestCase, testutil.ShouldFailMixin):
|
||||
d.addCallback(_listed)
|
||||
return d
|
||||
|
||||
def failUnlessGreaterOrEqualThan(self, a, b):
|
||||
self.failUnless(a >= b, "%s should be >= %s" % (a, b))
|
||||
|
||||
def test_create(self):
|
||||
self.expected_manifest = []
|
||||
|
||||
@ -238,10 +241,14 @@ class Dirnode(unittest.TestCase, testutil.ShouldFailMixin):
|
||||
def _check_timestamp(metadata):
|
||||
self.failUnless("ctime" in metadata)
|
||||
self.failUnless("mtime" in metadata)
|
||||
self.failUnless(metadata["ctime"] >= self._start_timestamp)
|
||||
self.failUnless(metadata["ctime"] <= self._stop_timestamp)
|
||||
self.failUnless(metadata["mtime"] >= self._start_timestamp)
|
||||
self.failUnless(metadata["mtime"] <= self._stop_timestamp)
|
||||
self.failUnlessGreaterOrEqualThan(metadata["ctime"],
|
||||
self._start_timestamp)
|
||||
self.failUnlessGreaterOrEqualThan(self._stop_timestamp,
|
||||
metadata["ctime"])
|
||||
self.failUnlessGreaterOrEqualThan(metadata["mtime"],
|
||||
self._start_timestamp)
|
||||
self.failUnlessGreaterOrEqualThan(self._stop_timestamp,
|
||||
metadata["mtime"])
|
||||
return n.delete("timestamps")
|
||||
d.addCallback(_check_timestamp)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user