mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 15:16:41 +00:00
webish: improve test coverage
This commit is contained in:
parent
6cd11037c6
commit
b7c18d6505
@ -1445,6 +1445,14 @@ class Web(WebMixin, unittest.TestCase):
|
|||||||
d.addCallback(_check2)
|
d.addCallback(_check2)
|
||||||
return d
|
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):
|
def test_PUT_NEWDIR_URI(self):
|
||||||
d = self.PUT("/uri?t=mkdir", "")
|
d = self.PUT("/uri?t=mkdir", "")
|
||||||
def _check(uri):
|
def _check(uri):
|
||||||
|
@ -23,7 +23,8 @@ class IClient(Interface):
|
|||||||
pass
|
pass
|
||||||
class ILocalAccess(Interface):
|
class ILocalAccess(Interface):
|
||||||
def local_access_is_allowed():
|
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
|
# 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.setResponseCode(http.BAD_REQUEST)
|
||||||
req.setHeader("content-type", "text/plain")
|
req.setHeader("content-type", "text/plain")
|
||||||
return "/uri only accepts PUT"
|
return "/uri only accepts PUT and PUT?t=mkdir"
|
||||||
|
|
||||||
|
|
||||||
class Root(rend.Page):
|
class Root(rend.Page):
|
||||||
|
Loading…
Reference in New Issue
Block a user