]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
more upload unit tests
authorBrian Warner <warner@lothar.com>
Mon, 4 Dec 2006 07:46:21 +0000 (00:46 -0700)
committerBrian Warner <warner@lothar.com>
Mon, 4 Dec 2006 07:46:21 +0000 (00:46 -0700)
allmydata/test/test_upload.py

index 333143b22454ac834eda20a6970c734a8175253b..a97dfe12c84c0f470d965ae9c4e2633801f58e4f 100644 (file)
@@ -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