]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
wui: fix bug in which empty directory is marked as "unreadable", add test, remove...
authorZooko O'Whielacronx <zooko@zooko.com>
Tue, 7 Apr 2009 18:28:34 +0000 (11:28 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Tue, 7 Apr 2009 18:28:34 +0000 (11:28 -0700)
src/allmydata/test/test_web.py
src/allmydata/web/directory.py
src/allmydata/web/directory.xhtml

index ef0b616a8a266f9ead32e91727e89585c599e0ef..d4d6cdbea7bb125575998d3ad5a3ac8ecd85dcdc 100644 (file)
@@ -917,7 +917,9 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, unittest.TestCase):
         # and an empty directory
         d.addCallback(lambda res: self.GET(self.public_url + "/foo/empty/"))
         def _check4(res):
-            self.failUnless("directory is empty!" in res, res)
+            self.failUnless("directory is empty" in res, res)
+            MKDIR_BUTTON_RE=re.compile('<input type="hidden" name="t" value="mkdir" />.*<legend class="freeform-form-label">Create a new directory</legend>.*<input type="submit" value="Create" />', re.I)
+            self.failUnless(MKDIR_BUTTON_RE.search(res), res)
         d.addCallback(_check4)
 
         return d
index 51837b11740a3e84ad862faf842ce3af92d4d7b0..204181946fec60a6e0bc3f0d554f52dc62faf12f 100644 (file)
@@ -658,7 +658,7 @@ class DirectoryAsHTML(rend.Page):
 
         if self.node.is_readonly():
             return T.div["No upload forms: directory is read-only"]
-        if not self.dirnode_children:
+        if self.dirnode_children is None:
             return T.div["No upload forms: directory is unreadable"]
 
         mkdir = T.form(action=".", method="post",
index 6038cd3f21041ec5487864d38fb140fe509228eb..db74d06df90e2ace44d6332d876e096547b18521 100644 (file)
@@ -38,7 +38,7 @@
     <td><n:slot name="info"/></td>
   </tr>
 
-  <tr n:pattern="empty"><td>directory is empty!</td></tr>
+  <tr n:pattern="empty"><td>directory is empty</td></tr>
 
 </table>
 </div>