]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
webish: improve test coverage
authorBrian Warner <warner@lothar.com>
Mon, 17 Sep 2007 08:53:46 +0000 (01:53 -0700)
committerBrian Warner <warner@lothar.com>
Mon, 17 Sep 2007 08:53:46 +0000 (01:53 -0700)
src/allmydata/test/test_web.py
src/allmydata/webish.py

index 82bb61b40e7375fd6e6a68c0beeb0f39303395f6..fae96aba01cb3386d9274ec53305903511f34ec4 100644 (file)
@@ -1445,6 +1445,14 @@ class Web(WebMixin, unittest.TestCase):
         d.addCallback(_check2)
         return d
 
+    def test_PUT_NEWFILE_URI_only_PUT(self):
+        d = self.PUT("/uri?t=bogus", "")
+        d.addBoth(self.shouldFail, error.Error,
+                  "PUT_NEWFILE_URI_only_PUT",
+                  "400 Bad Request",
+                  "/uri only accepts PUT and PUT?t=mkdir")
+        return d
+
     def test_PUT_NEWDIR_URI(self):
         d = self.PUT("/uri?t=mkdir", "")
         def _check(uri):
index 9b6639e2be7b4f9cfe88e116a1ee87690edcbca7..a1e9933830556d4cf8b1a7daec7a3a1f1dc5c4dd 100644 (file)
@@ -23,7 +23,8 @@ class IClient(Interface):
     pass
 class ILocalAccess(Interface):
     def local_access_is_allowed():
-        pass
+        """Return True if t=upload&localdir= is allowed, giving anyone who
+        can talk to the webserver control over the local (disk) filesystem."""
 
 
 # we must override twisted.web.http.Request.requestReceived with a version
@@ -1050,7 +1051,7 @@ class URIPUTHandler(rend.Page):
 
         req.setResponseCode(http.BAD_REQUEST)
         req.setHeader("content-type", "text/plain")
-        return "/uri only accepts PUT"
+        return "/uri only accepts PUT and PUT?t=mkdir"
 
 
 class Root(rend.Page):