1df4b11aef
CI / lint-test-build (push) Failing after 1m7s
- Introduced new HTML templates for the dashboard, metrics, overview, and backtesting functionalities. - Implemented partial templates for metrics, overview, audit, controls, and charts to enhance modularity. - Updated the Jinja2 template resolution logic to support different deployment environments. - Added a health check template to display the service status. - Included a test suite to verify the template resolution logic. - Updated `pyproject.toml` to include new HTML templates in the package data.
20 lines
519 B
Python
20 lines
519 B
Python
from importlib import resources
|
|
from pathlib import Path
|
|
|
|
from arbitrade.api import routes
|
|
|
|
|
|
def test_template_directory_resolves_to_existing_location() -> None:
|
|
template_dir = Path(routes._resolve_templates_directory())
|
|
|
|
assert template_dir.is_dir()
|
|
assert (template_dir / "dashboard.html").is_file()
|
|
|
|
|
|
def test_template_exists_in_package_resources() -> None:
|
|
template_path = resources.files("arbitrade").joinpath(
|
|
"web", "templates", "dashboard.html"
|
|
)
|
|
|
|
assert template_path.is_file()
|