From: Brian Warner Date: Fri, 6 Apr 2007 23:36:22 +0000 (-0700) Subject: test_util.py: fix problems X-Git-Url: https://git.rkrishnan.org/vdrive/components/COPYING.GPL?a=commitdiff_plain;h=e74e370d00ed5d27b7fa100f06d23679e221e740;p=tahoe-lafs%2Ftahoe-lafs.git test_util.py: fix problems --- diff --git a/src/allmydata/test/test_util.py b/src/allmydata/test/test_util.py index b023ddc3..32e976db 100644 --- a/src/allmydata/test/test_util.py +++ b/src/allmydata/test/test_util.py @@ -28,19 +28,21 @@ class NoArgumentException(Exception): class HumanReadable(unittest.TestCase): def test_repr(self): hr = humanreadable.hr - self.failUnlessEqual(hr(foo), "") + self.failUnlessEqual(hr(foo), "") self.failUnlessEqual(hr(self.test_repr), - ">") + ">") self.failUnlessEqual(hr(1L), "1") self.failUnlessEqual(hr(10**40), "100000000000000000...000000000000000000") - self.failUnlessEqual(hr(self), "") + self.failUnlessEqual(hr(self), "") self.failUnlessEqual(hr([1,2]), "[1, 2]") self.failUnlessEqual(hr({1:2}), "{1:2}") try: raise RuntimeError except Exception, e: - self.failUnlessEqual(hr(e), "") + self.failUnless( + hr(e) == "" # python-2.4 + or hr(e) == "RuntimeError()") # python-2.5 try: raise RuntimeError("oops") except Exception, e: