MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / tests_list

Function tests_list

unity_cli/cli/commands/tests.py:192–225  ·  view source on GitHub ↗

List every discoverable test name in the given mode. Helpful for picking exact values for --test-names or --group-pattern. Examples: u tests list edit u tests list play --json

(
    ctx: typer.Context,
    mode: Annotated[str, typer.Argument(help="Test mode (edit or play)", autocompletion=_complete_test_mode)] = "edit",
    json_flag: Annotated[
        bool,
        typer.Option("--json", help="Output as JSON"),
    ] = False,
)

Source from the content-addressed store, hash-verified

190
191@tests_app.command("list")
192def tests_list(
193 ctx: typer.Context,
194 mode: Annotated[str, typer.Argument(help="Test mode (edit or play)", autocompletion=_complete_test_mode)] = "edit",
195 json_flag: Annotated[
196 bool,
197 typer.Option("--json", help="Output as JSON"),
198 ] = False,
199) -> None:
200 """List every discoverable test name in the given mode.
201
202 Helpful for picking exact values for --test-names or --group-pattern.
203
204 Examples:
205 u tests list edit
206 u tests list play --json
207 """
208 context: CLIContext = ctx.obj
209 try:
210 result = context.client.tests.list(mode=mode)
211 if _should_json(context, json_flag):
212 print_json(result, None)
213 else:
214 tests = result.get("tests", [])
215 if is_no_color():
216 for t in tests:
217 name = t.get("fullName", str(t)) if isinstance(t, dict) else str(t)
218 print_plain_item(name)
219 else:
220 print_line(f"[bold]Tests ({escape(mode)}Mode): {len(tests)}[/bold]")
221 for t in tests:
222 name = t.get("fullName", str(t)) if isinstance(t, dict) else str(t)
223 print_line(f" {escape(name)}")
224 except UnityCLIError as e:
225 _handle_error(e)
226
227
228@tests_app.command("status")

Callers

nothing calls this directly

Calls 8

_should_jsonFunction · 0.90
print_jsonFunction · 0.90
is_no_colorFunction · 0.90
print_plain_itemFunction · 0.90
print_lineFunction · 0.90
_handle_errorFunction · 0.90
listMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected