From de8475389bd473390c654f88b0ac6127a144d991 Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Fri, 3 Apr 2009 16:56:14 -0700 Subject: [PATCH] hashtree: fix tests of depth_of --- src/allmydata/test/test_hashtree.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/allmydata/test/test_hashtree.py b/src/allmydata/test/test_hashtree.py index 75b4c933..30d99194 100644 --- a/src/allmydata/test/test_hashtree.py +++ b/src/allmydata/test/test_hashtree.py @@ -82,14 +82,13 @@ class Incomplete(unittest.TestCase): def test_depth_of(self): ht = hashtree.IncompleteHashTree(8) - self.failUnlessEqual(ht.depth_of(0), 0) + self.failUnlessEqual(hashtree.depth_of(0), 0) for i in [1,2]: - self.failUnlessEqual(ht.depth_of(i), 1, "i=%d"%i) + self.failUnlessEqual(hashtree.depth_of(i), 1, "i=%d"%i) for i in [3,4,5,6]: - self.failUnlessEqual(ht.depth_of(i), 2, "i=%d"%i) + self.failUnlessEqual(hashtree.depth_of(i), 2, "i=%d"%i) for i in [7,8,9,10,11,12,13,14]: - self.failUnlessEqual(ht.depth_of(i), 3, "i=%d"%i) - self.failUnlessRaises(IndexError, ht.depth_of, 15) + self.failUnlessEqual(hashtree.depth_of(i), 3, "i=%d"%i) def test_large(self): # IncompleteHashTree.set_hashes() used to take O(N**2). This test is -- 2.45.2