Adding flask and heartbeat
This commit is contained in:
21
tests/test_heartbeat.py
Normal file
21
tests/test_heartbeat.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import pytest
|
||||
from src.app import app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
app.config["TESTING"] = True
|
||||
with app.test_client() as client:
|
||||
yield client
|
||||
|
||||
|
||||
def test_heartbeat_status_code(client):
|
||||
response = client.get("/heartbeat")
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_heartbeat_payload(client):
|
||||
response = client.get("/heartbeat")
|
||||
data = response.get_json()
|
||||
assert data["status"] == "ok"
|
||||
assert "timestamp" in data
|
||||
Reference in New Issue
Block a user