]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
tests for "Available" column (#648)
authorLeif Ryge <leif@synthesize.us>
Sat, 22 Nov 2014 02:12:36 +0000 (02:12 +0000)
committerDaira Hopwood <daira@jacaranda.org>
Sun, 23 Nov 2014 06:03:00 +0000 (06:03 +0000)
thanks to the anonymous author who posted this on trac

src/allmydata/test/test_storage.py
src/allmydata/test/test_web.py

index 5c5e2c7c02bae554f3a818885bcd2eab2e2d9a80..c63323ad59ca33071030da0e4631d0bf400ad77a 100644 (file)
@@ -332,6 +332,12 @@ class Server(unittest.TestCase):
         self.failUnlessIn('maximum-immutable-share-size', sv1)
         self.failUnlessIn('maximum-mutable-share-size', sv1)
 
+    def test_declares_available_space(self):
+        ss = self.create("test_declares_available_space")
+        ver = ss.remote_get_version()
+        sv1 = ver['http://allmydata.org/tahoe/protocols/storage/v1']
+        self.failUnlessIn('available-space', sv1)
+
     def allocate(self, ss, storage_index, sharenums, size, canary=None):
         renew_secret = hashutil.tagged_hash("blah", "%d" % self._lease_secret.next())
         cancel_secret = hashutil.tagged_hash("blah", "%d" % self._lease_secret.next())
index 14684c3861e6813bc2060de6f72d5670da462dcd..8c5ead4ba62ff89b24be7ac24511e73ea0bfbfce 100644 (file)
@@ -192,7 +192,7 @@ class FakeDisplayableServer(StubServer):
     def get_nickname(self):
         return self.announcement["nickname"]
     def get_available_space(self):
-        return 0
+        return 123456
 
 class FakeBucketCounter(object):
     def get_state(self):
@@ -620,6 +620,8 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
             self.failUnlessIn(u'<td>fake_nickname \u263A</td>', res_u)
             self.failUnlessIn(u'<div class="nickname">other_nickname \u263B</div>', res_u)
             self.failUnlessIn(u'\u00A9 <a href="https://tahoe-lafs.org/">Tahoe-LAFS Software Foundation', res_u)
+            self.failUnlessIn('<td><h3>Available</h3></td>', res)
+            self.failUnlessIn('123.5kB', res)
 
             self.s.basedir = 'web/test_welcome'
             fileutil.make_dirs("web/test_welcome")