From: Zooko O'Whielacronx Date: Fri, 3 Apr 2009 23:56:14 +0000 (-0700) Subject: hashtree: fix tests of depth_of X-Git-Tag: allmydata-tahoe-1.4.0~25 X-Git-Url: https://git.rkrishnan.org/install-details.html?a=commitdiff_plain;h=de8475389bd473390c654f88b0ac6127a144d991;p=tahoe-lafs%2Ftahoe-lafs.git hashtree: fix tests of depth_of --- 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