You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
430 B
Python
22 lines
430 B
Python
import pytest
|
|
from litestar.testing import TestClient
|
|
|
|
from speech_collect.app import app
|
|
|
|
|
|
@pytest.fixture
|
|
def client():
|
|
return TestClient(app=app)
|
|
|
|
|
|
def test_index_route(client):
|
|
resp = client.get("/")
|
|
assert resp.status_code == 200
|
|
assert resp.text == "Hello, world!"
|
|
|
|
|
|
def test_get_book(client):
|
|
resp = client.get("/books/1337")
|
|
assert resp.status_code == 200
|
|
assert resp.json()["book_id"] == 1337
|