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,
)
| 190 | |
| 191 | @tests_app.command("list") |
| 192 | def 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") |
nothing calls this directly
no test coverage detected