mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-10 04:09:58 +00:00
Expect ErrorPage in RenderSlashUri tests
This commit is contained in:
parent
c16cf00c6b
commit
fd5436b867
@ -57,8 +57,17 @@ class RenderSlashUri(unittest.TestCase):
|
||||
A (trivially) invalid capbility is an error
|
||||
"""
|
||||
self.request.args[b"uri"] = [b"not a capability"]
|
||||
with self.assertRaises(WebError):
|
||||
self.res.render_GET(self.request)
|
||||
response_body = self.res.render_GET(self.request)
|
||||
|
||||
self.assertIn(
|
||||
"<title>400 - Error</title>", response_body,
|
||||
)
|
||||
self.assertIn(
|
||||
"<h1>Error</h1>", response_body,
|
||||
)
|
||||
self.assertIn(
|
||||
"<p>Invalid capability</p>", response_body,
|
||||
)
|
||||
|
||||
@given(
|
||||
text()
|
||||
@ -68,8 +77,17 @@ class RenderSlashUri(unittest.TestCase):
|
||||
Let hypothesis try a bunch of invalid capabilities
|
||||
"""
|
||||
self.request.args[b"uri"] = [cap.encode('utf8')]
|
||||
with self.assertRaises(WebError):
|
||||
self.res.render_GET(self.request)
|
||||
response_body = self.res.render_GET(self.request)
|
||||
|
||||
self.assertIn(
|
||||
"<title>400 - Error</title>", response_body,
|
||||
)
|
||||
self.assertIn(
|
||||
"<h1>Error</h1>", response_body,
|
||||
)
|
||||
self.assertIn(
|
||||
"<p>Invalid capability</p>", response_body,
|
||||
)
|
||||
|
||||
|
||||
class RenderServiceRow(unittest.TestCase):
|
||||
|
Loading…
x
Reference in New Issue
Block a user