mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-31 08:13:11 +03:00
fix(packaging): keep source clients in lockstep
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
from types import SimpleNamespace
|
||||
|
||||
from nanobot.cli.webui_support import _prepare_webui_bundle_for_gateway
|
||||
from nanobot.config.schema import Config
|
||||
|
||||
|
||||
def test_source_checkout_rebuilds_the_webui_from_every_gateway_entrypoint(monkeypatch) -> None:
|
||||
modes: list[str] = []
|
||||
monkeypatch.setattr(
|
||||
"nanobot.cli.webui_support.inspect_webui_bundle",
|
||||
lambda: SimpleNamespace(source_available=True),
|
||||
)
|
||||
monkeypatch.setattr("nanobot.cli.webui_support._webui_channel_enabled", lambda _config: True)
|
||||
monkeypatch.setattr(
|
||||
"nanobot.cli.webui_support.ensure_webui_bundle",
|
||||
lambda **kwargs: modes.append(kwargs["mode"]),
|
||||
)
|
||||
|
||||
_prepare_webui_bundle_for_gateway(Config(), mode="warn")
|
||||
|
||||
assert modes == ["auto"]
|
||||
|
||||
|
||||
def test_vite_mode_does_not_build_the_source_webui_bundle(monkeypatch) -> None:
|
||||
modes: list[str] = []
|
||||
monkeypatch.setattr(
|
||||
"nanobot.cli.webui_support.inspect_webui_bundle",
|
||||
lambda: SimpleNamespace(source_available=True),
|
||||
)
|
||||
monkeypatch.setattr("nanobot.cli.webui_support._webui_channel_enabled", lambda _config: True)
|
||||
monkeypatch.setattr(
|
||||
"nanobot.cli.webui_support.ensure_webui_bundle",
|
||||
lambda **kwargs: modes.append(kwargs["mode"]),
|
||||
)
|
||||
|
||||
_prepare_webui_bundle_for_gateway(Config(), mode="skip")
|
||||
|
||||
assert modes == ["skip"]
|
||||
Reference in New Issue
Block a user