mirror of
https://github.com/facefusion/facefusion.git
synced 2026-09-16 12:35:27 +02:00
root info for the api
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
from typing import Iterator
|
||||
|
||||
import pytest
|
||||
from starlette.testclient import TestClient
|
||||
|
||||
from facefusion import metadata, session_manager
|
||||
from facefusion.apis.core import create_api
|
||||
|
||||
|
||||
@pytest.fixture(scope = 'function', autouse = True)
|
||||
def before_each() -> None:
|
||||
session_manager.API_SESSIONS.clear()
|
||||
|
||||
|
||||
@pytest.fixture(scope = 'module')
|
||||
def test_client() -> Iterator[TestClient]:
|
||||
with TestClient(create_api()) as test_client:
|
||||
yield test_client
|
||||
|
||||
|
||||
def test_get_root(test_client : TestClient) -> None:
|
||||
root_response = test_client.get('/')
|
||||
root_body = root_response.json()
|
||||
|
||||
assert root_body.get('name') == metadata.get('name')
|
||||
assert root_body.get('description') == metadata.get('description')
|
||||
assert root_body.get('version') == metadata.get('version')
|
||||
assert root_response.status_code == 200
|
||||
Reference in New Issue
Block a user