]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
mutable/servermap: improve test coverage
authorBrian Warner <warner@allmydata.com>
Sat, 19 Apr 2008 03:13:28 +0000 (20:13 -0700)
committerBrian Warner <warner@allmydata.com>
Sat, 19 Apr 2008 03:13:28 +0000 (20:13 -0700)
src/allmydata/test/test_mutable.py

index b3d78815dd4b07dafddef554b21c3870ed6a9c84..9018dc445e910a46938e7a2bb3aa5cda33c884b2 100644 (file)
@@ -599,6 +599,10 @@ class Servermap(unittest.TestCase):
         self.failUnlessEqual(sm.recoverable_versions(), set([best]))
         self.failUnlessEqual(len(sm.shares_available()), 1)
         self.failUnlessEqual(sm.shares_available()[best], (num_shares, 3))
+        shnum, peerids = sm.make_sharemap().items()[0]
+        peerid = list(peerids)[0]
+        self.failUnlessEqual(sm.version_on_peer(peerid, shnum), best)
+        self.failUnlessEqual(sm.version_on_peer(peerid, 666), None)
         return sm
 
     def test_basic(self):