pbr-ayct-backend/tests/test_ayct_backend.py

20 lines
422 B
Python
Raw Normal View History

import os
import tempfile
import pytest
2021-12-01 14:25:42 +01:00
from ayct_backend import create_app
@pytest.fixture
def client():
app = create_app()
2021-12-01 14:25:42 +01:00
app.config['TESTING'] = True
app.run(host = '0.0.0.0', port = 5000)
with app.test_client() as client:
with app.app_context():
pass
yield client
def test_first_endpoint(client):
rv = client.get("/hello")
assert b'All You Can Tweet' in rv.data