From: Brian Warner Date: Mon, 4 Dec 2006 07:46:21 +0000 (-0700) Subject: more upload unit tests X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~472 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/%22doc.html/README.win32?a=commitdiff_plain;h=cd3ad76cfbe09d2d84a9a8d2f5f51952f69706ed;p=tahoe-lafs%2Ftahoe-lafs.git more upload unit tests --- diff --git a/allmydata/test/test_upload.py b/allmydata/test/test_upload.py index 333143b2..a97dfe12 100644 --- a/allmydata/test/test_upload.py +++ b/allmydata/test/test_upload.py @@ -151,3 +151,27 @@ class NextPeer(unittest.TestCase): ]) d.addCallback(_check) return d + + responses3 = ["good", # 0 + "good", # 1 + "good", # 2 + "good", # 3 + "good", # 4 + ] + + def test_4(self): + c = FakeClient(self.responses3) + u = NextPeerUploader(c) + u._verifierid = "verifierid" + u._shares = 4 + u._share_size = 100 + d = u.start() + def _check(res): + self.failUnlessEqual(u.goodness_points, 4) + self.compare_landlords(u, c, [(0, 0), + (1, 1), + (2, 2), + (3, 3), + ]) + d.addCallback(_check) + return d