diabets_app/server/tests/test_diabets_app.py

21 lines
488 B
Python

from diabets_app import __version__
def test_version():
assert __version__ == '0.1.0'
def test_ping(app, client):
res = client.get('/ping')
assert res.status_code == 200
assert res.get_data(as_text=True) == '"ping pong sandra!"\n'
def test_calc(app, client):
data = {'number1': '1', 'number2': '2'}
res = client.post('/calc', json=data)
response = res.json
assert response['status'] == 'success'
assert response['text'] == 3