mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-10-26 22:01:59 -06:00
Fix Engine static root fallback for legacy WebUI
This commit is contained in:
@@ -42,3 +42,20 @@ def test_static_root_env_override(tmp_path, monkeypatch):
|
||||
|
||||
monkeypatch.delenv("BOREALIS_STATIC_ROOT", raising=False)
|
||||
monkeypatch.delenv("BOREALIS_ROOT", raising=False)
|
||||
|
||||
|
||||
def test_static_root_falls_back_to_legacy_source(tmp_path, monkeypatch):
|
||||
"""Legacy WebUI source should be served when no build assets exist."""
|
||||
|
||||
legacy_source = tmp_path / "Data" / "Server" / "WebUI"
|
||||
legacy_source.mkdir(parents=True)
|
||||
(legacy_source / "index.html").write_text("<html></html>", encoding="utf-8")
|
||||
|
||||
monkeypatch.setenv("BOREALIS_ROOT", str(tmp_path))
|
||||
monkeypatch.delenv("BOREALIS_STATIC_ROOT", raising=False)
|
||||
|
||||
settings = load_environment()
|
||||
|
||||
assert settings.flask.static_root == legacy_source.resolve()
|
||||
|
||||
monkeypatch.delenv("BOREALIS_ROOT", raising=False)
|
||||
|
||||
Reference in New Issue
Block a user