Keep web Material styling and preserve visible installer access URLs
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import importlib.util
|
||||
import io
|
||||
import json
|
||||
from contextlib import redirect_stdout
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tempfile
|
||||
@@ -24,6 +26,25 @@ class Runner:
|
||||
|
||||
|
||||
class AppBuildTests(unittest.TestCase):
|
||||
def test_web_urls_include_saved_port_lan_and_public_origin(self):
|
||||
manifest = {"web": {"host": "0.0.0.0", "port": 8096},
|
||||
"public_url": "http://192.168.1.20:8090",
|
||||
"opencode_env": {"PIPELINES_WEB_PUBLIC_URL": "https://pipelines.example.com"}}
|
||||
with redirect_stdout(io.StringIO()) as output:
|
||||
app_build.print_web_urls(manifest)
|
||||
self.assertEqual(output.getvalue().splitlines()[-3:], [
|
||||
" http://localhost:8096/", " http://192.168.1.20:8096/",
|
||||
" https://pipelines.example.com/"])
|
||||
|
||||
def test_web_install_ends_with_access_urls(self):
|
||||
manifest = {"web": {"host": "127.0.0.1", "port": 8083, "root": "/unused"}}
|
||||
with patch.object(app_build, "docker_available", return_value=True), \
|
||||
patch.object(app_build, "load_manifest", return_value=manifest), \
|
||||
patch.object(app_build, "build"), patch.object(app_build, "install_tree"), \
|
||||
redirect_stdout(io.StringIO()) as output:
|
||||
app_build.main(["web"])
|
||||
self.assertEqual(output.getvalue().splitlines()[-1], " http://localhost:8083/")
|
||||
|
||||
def setUp(self):
|
||||
self.home = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(self.home.cleanup)
|
||||
|
||||
Reference in New Issue
Block a user