Files
wehub-resource-sync 4b6817381b
Benchmark image — build + push to ECR (any adapter) / build + push (push) Waiting to run
CI / quality (ubuntu-latest) (push) Waiting to run
CI / test (tools-runtime) (push) Waiting to run
CI / test (e2e-general) (push) Waiting to run
CI / test (cli-runtime) (push) Waiting to run
CI / test (e2e-provider-and-openclaw) (push) Waiting to run
CI / test (integrations-and-misc) (push) Waiting to run
CI / coverage-report (push) Blocked by required conditions
CI / test-kubernetes (push) Waiting to run
CI / should-run-thorough (push) Waiting to run
CI / test-thorough (cloudwatch-demo) (push) Blocked by required conditions
CI / test-thorough (flink-ecs) (push) Blocked by required conditions
CI / test-thorough (upstream-lambda) (push) Blocked by required conditions
CI / test-thorough (prefect-ecs-fargate) (push) Blocked by required conditions
CodeQL / Analyze (python) (push) Waiting to run
Release / build-binaries (zip, opensre.exe, onefile, windows-latest, windows-x64) (push) Blocked by required conditions
Release / publish-release (push) Blocked by required conditions
Release / publish-main-release (push) Blocked by required conditions
Release / prepare (push) Waiting to run
Release / verify (push) Blocked by required conditions
Release / build-python-dist (push) Blocked by required conditions
Release / build-binaries (tar.gz, opensre, onedir, macos-15-intel, darwin-x64) (push) Blocked by required conditions
Release / build-binaries (tar.gz, opensre, onedir, macos-latest, darwin-arm64) (push) Blocked by required conditions
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04, linux-x64) (push) Blocked by required conditions
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04-arm, linux-arm64) (push) Blocked by required conditions
Synthetic Deterministic Tests / Synthetic offline (deterministic) (push) Waiting to run
Interactive Shell Live (PR + post-merge) / turn-checks (no-LLM) (push) Waiting to run
Interactive Shell Live (PR + post-merge) / turn-live shard ${{ matrix.shard_index }} (push) Waiting to run
CI (OpenClaw E2E) / openclaw test (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:10:45 +08:00

96 lines
2.3 KiB
Python

from __future__ import annotations
import click
from platform.common.runtime_flags import (
configure_runtime_flags,
is_debug,
is_json_output,
is_verbose,
is_yes,
reset_runtime_flags,
)
from surfaces.cli.runtime_flags import sync_runtime_flags_from_click
def test_is_json_output_true() -> None:
reset_runtime_flags()
configure_runtime_flags(json=True)
assert is_json_output() is True
def test_is_json_output_false() -> None:
reset_runtime_flags()
configure_runtime_flags(json=False)
assert is_json_output() is False
def test_is_verbose_true() -> None:
reset_runtime_flags()
configure_runtime_flags(verbose=True)
assert is_verbose() is True
def test_is_verbose_false() -> None:
reset_runtime_flags()
configure_runtime_flags(verbose=False)
assert is_verbose() is False
def test_is_debug_true() -> None:
reset_runtime_flags()
configure_runtime_flags(debug=True)
assert is_debug() is True
def test_is_debug_false() -> None:
reset_runtime_flags()
configure_runtime_flags(debug=False)
assert is_debug() is False
def test_is_yes_true() -> None:
reset_runtime_flags()
configure_runtime_flags(yes=True)
assert is_yes() is True
def test_is_yes_false() -> None:
reset_runtime_flags()
configure_runtime_flags(yes=False)
assert is_yes() is False
def test_defaults_without_configuration() -> None:
reset_runtime_flags()
assert is_json_output() is False
assert is_verbose() is False
assert is_debug() is False
assert is_yes() is False
def test_sync_runtime_flags_from_click_root() -> None:
reset_runtime_flags()
root_ctx = click.Context(click.Command("root"))
root_ctx.obj = {"json": True, "verbose": False, "debug": True, "yes": True}
child_ctx = click.Context(click.Command("child"), parent=root_ctx)
child_ctx.obj = {"json": False}
sync_runtime_flags_from_click(child_ctx)
assert is_json_output() is True
assert is_verbose() is False
assert is_debug() is True
assert is_yes() is True
def test_sync_runtime_flags_from_click_none_obj() -> None:
reset_runtime_flags()
ctx = click.Context(click.Command("root"))
ctx.obj = None
sync_runtime_flags_from_click(ctx)
assert is_json_output() is False
assert is_verbose() is False
assert is_debug() is False
assert is_yes() is False