add health endpoint
This commit is contained in:
parent
cd196c2143
commit
fa39283bf4
2 changed files with 9 additions and 0 deletions
|
@ -18,6 +18,11 @@ logger = logging.getLogger(__name__)
|
|||
routes = web.RouteTableDef()
|
||||
|
||||
|
||||
@routes.get("/health")
|
||||
async def get_health(request: web_request.Request) -> web.Response:
|
||||
return web.Response(status=200)
|
||||
|
||||
|
||||
@routes.post("/alert")
|
||||
async def create_alert(request: web_request.Request) -> web.Response:
|
||||
data = await request.json()
|
||||
|
|
|
@ -140,6 +140,10 @@ class WebhookApplicationTestCase(aiohttp.test_utils.AioHTTPTestCase):
|
|||
)
|
||||
fake_send_text_to_room.assert_called_once()
|
||||
|
||||
async def test_health(self) -> None:
|
||||
async with self.client.request("GET", "/health") as response:
|
||||
self.assertEqual(200, response.status)
|
||||
|
||||
|
||||
class WebhookServerTestCase(unittest.IsolatedAsyncioTestCase):
|
||||
async def asyncSetUp(self) -> None:
|
||||
|
|
Loading…
Reference in a new issue