From: Brian Warner Date: Mon, 11 Feb 2008 21:13:07 +0000 (-0700) Subject: test_dirnode.py: add diag output to test-ctime/mtime tests X-Git-Tag: allmydata-tahoe-0.8.0~102 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/flags/rgr-080307.php?a=commitdiff_plain;h=b90eaf75dabd59a3c2d07163575e838513c87b66;p=tahoe-lafs%2Ftahoe-lafs.git test_dirnode.py: add diag output to test-ctime/mtime tests --- diff --git a/src/allmydata/test/test_dirnode.py b/src/allmydata/test/test_dirnode.py index 1b896403..5e27e4a5 100644 --- a/src/allmydata/test/test_dirnode.py +++ b/src/allmydata/test/test_dirnode.py @@ -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)