def test_call(self, name_mock, content_mock, ip_mock):
handler = TestBaseHandler.DummyHandler()
env = Environ({"wsgi.input": None})
request = Request(env)
request.form = { 'param': 42 }
res = handler._call(handler.dummy_endpoint, {}, request)
self.assertEqual(43, res["incremented"])
Logger.c.execute("SELECT * FROM logs WHERE category = 'HTTP'")
row = Logger.c.fetchone()
self.assertIn("1.2.3.4", row[3])
self.assertIn("dummy_endpoint", row[3])
test_base_handler.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录