Return groups list or skip if fewer than `minimum` are available.
(api_client, minimum=1)
| 121 | |
| 122 | |
| 123 | def _require_groups(api_client, minimum=1): |
| 124 | """Return groups list or skip if fewer than `minimum` are available.""" |
| 125 | try: |
| 126 | groups = api_client.command("ui.window.listGroups").get("groups", []) |
| 127 | except APIError as e: |
| 128 | pytest.skip(f"ui.window.listGroups unavailable: {e}") |
| 129 | |
| 130 | if len(groups) < minimum: |
| 131 | pytest.skip(f"Need at least {minimum} group(s); got {len(groups)}") |
| 132 | |
| 133 | return groups |
| 134 | |
| 135 | |
| 136 | def _require_windows(api_client): |
no test coverage detected