FitTrackee/fittrackee/tests/application/test_health_check_api.py

15 lines
456 B
Python
Raw Permalink Normal View History

2020-05-10 15:55:56 +02:00
import json
2021-01-02 19:28:03 +01:00
from flask import Flask
2020-05-10 15:55:56 +02:00
class TestHealthCheck:
2021-01-02 19:28:03 +01:00
def test_it_returns_pong_on_health_check(self, app: Flask) -> None:
2021-05-22 17:14:24 +02:00
"""=> Ensure the /health_check route behaves correctly."""
2020-05-10 15:55:56 +02:00
client = app.test_client()
response = client.get('/api/ping')
data = json.loads(response.data.decode())
assert response.status_code == 200
assert 'pong' in data['message']
assert 'success' in data['status']