sms-handler/tests/basic.py

22 lines
526 B
Python
Raw Normal View History

2024-12-01 00:53:31 +01:00
from fastapi.testclient import TestClient
from sms_handler.server import app
client = TestClient(app)
def test_handle_sms():
with TestClient(app) as client:
response = client.post(
"/handle-sms",
json={
"text": "Hello!",
"from": "12345678",
"sentStamp": "1234",
"receivedStamp": "1235",
"sim": "1",
},
)
assert response.status_code == 200
assert response.json() == "OK"