MCPcopy
hub / github.com/aio-libs/aiohttp / test_raise_method_not_found

Method test_raise_method_not_found

tests/test_urldispatch.py:223–236  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

221 self.assertEqual({'POST', 'GET'}, exc.allowed_methods)
222
223 def test_raise_method_not_found(self):
224 handler = self.make_handler()
225 self.router.add_route('GET', '/a', handler)
226 req = self.make_request('GET', '/b')
227
228 match_info = self.loop.run_until_complete(self.router.resolve(req))
229 self.assertIsInstance(match_info.route, SystemRoute)
230 self.assertEqual({}, match_info)
231
232 with self.assertRaises(HTTPNotFound) as ctx:
233 self.loop.run_until_complete(match_info.handler(req))
234
235 exc = ctx.exception
236 self.assertEqual(404, exc.status)
237
238 def test_double_add_url_with_the_same_name(self):
239 handler1 = self.make_handler()

Callers

nothing calls this directly

Calls 5

make_handlerMethod · 0.95
make_requestMethod · 0.95
add_routeMethod · 0.45
resolveMethod · 0.45
handlerMethod · 0.45

Tested by

no test coverage detected