2026-06-08 20:33:47 +02:00
|
|
|
"""Test fixtures and app factory for the test suite."""
|
2026-06-06 10:18:15 +02:00
|
|
|
|
2026-06-08 20:33:47 +02:00
|
|
|
import os
|
2026-06-06 10:18:15 +02:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
from cteward_ng.app import create_app
|
|
|
|
|
|
|
|
|
|
|
2026-06-08 20:33:47 +02:00
|
|
|
# Resolve the test config relative to this package directory
|
|
|
|
|
_TEST_CONFIG = os.path.join(
|
|
|
|
|
os.path.dirname(__file__), '..', 'st-lexware-test.json'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
2026-06-06 10:18:15 +02:00
|
|
|
@pytest.fixture
|
|
|
|
|
def app():
|
|
|
|
|
"""Create a test Flask app using the test config."""
|
2026-06-08 20:33:47 +02:00
|
|
|
app = create_app(config_path=_TEST_CONFIG)
|
2026-06-06 10:18:15 +02:00
|
|
|
app.config['TESTING'] = True
|
|
|
|
|
return app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def client(app):
|
|
|
|
|
"""Test client for making requests."""
|
|
|
|
|
return app.test_client()
|