mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-29 01:08:54 +00:00
simple error-case for URIHandler.render_GET
This commit is contained in:
parent
3adaf5a956
commit
fc32d1e377
@ -7,6 +7,7 @@ from ...storage_client import NativeStorageServer
|
|||||||
from ...web.root import Root
|
from ...web.root import Root
|
||||||
from ...util.connection_status import ConnectionStatus
|
from ...util.connection_status import ConnectionStatus
|
||||||
from allmydata.web.root import URIHandler
|
from allmydata.web.root import URIHandler
|
||||||
|
from allmydata.web.common import WebError
|
||||||
|
|
||||||
from nevow.inevow import IRequest
|
from nevow.inevow import IRequest
|
||||||
|
|
||||||
@ -61,9 +62,16 @@ class RenderSlashUri(unittest.TestCase):
|
|||||||
"mukesarwdjxiyqsjinbfiiro6q7kgmmekocxfjcngh23oxwyxtzq:2:5:5874882"
|
"mukesarwdjxiyqsjinbfiiro6q7kgmmekocxfjcngh23oxwyxtzq:2:5:5874882"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
self.res.render_GET(self.request)
|
self.res.render_GET(self.request)
|
||||||
|
|
||||||
|
def test_invalid(self):
|
||||||
|
"""
|
||||||
|
A (trivially) invalid capbility is an error
|
||||||
|
"""
|
||||||
|
self.request.fields["uri"] = FakeField(value="not a capability")
|
||||||
|
with self.assertRaises(WebError):
|
||||||
|
self.res.render_GET(self.request)
|
||||||
|
|
||||||
|
|
||||||
class RenderServiceRow(unittest.TestCase):
|
class RenderServiceRow(unittest.TestCase):
|
||||||
def test_missing(self):
|
def test_missing(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user