From e74e370d00ed5d27b7fa100f06d23679e221e740 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 6 Apr 2007 16:36:22 -0700 Subject: [PATCH] test_util.py: fix problems --- src/allmydata/test/test_util.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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: -- 2.45.2