mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-12-15 00:35:47 -07:00
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
# ======================================================
|
|
# Data\Engine\Unit_Tests\test_web_ui.py
|
|
# Description: Ensures Engine WebUI static routing and SPA fallback respond as expected.
|
|
#
|
|
# API Endpoints (if applicable): None
|
|
# ======================================================
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
def test_web_ui_root_serves_index(engine_harness):
|
|
client = engine_harness.app.test_client()
|
|
response = client.get("/")
|
|
assert response.status_code == 200
|
|
body = response.get_data(as_text=True)
|
|
assert "Engine Test UI" in body
|
|
|
|
|
|
def test_web_ui_serves_static_assets(engine_harness):
|
|
client = engine_harness.app.test_client()
|
|
response = client.get("/assets/example.txt")
|
|
assert response.status_code == 200
|
|
assert response.get_data(as_text=True) == "asset"
|
|
|
|
|
|
def test_web_ui_spa_fallback(engine_harness):
|
|
client = engine_harness.app.test_client()
|
|
response = client.get("/devices")
|
|
assert response.status_code == 200
|
|
assert "Engine Test UI" in response.get_data(as_text=True)
|