(name: str, func: Callable[[], bool | str])
| 59 | |
| 60 | |
| 61 | def _check(name: str, func: Callable[[], bool | str]) -> CapabilityCheck: |
| 62 | try: |
| 63 | detail = func() |
| 64 | except Exception as exc: |
| 65 | return CapabilityCheck(name, False, f"{type(exc).__name__}: {exc}") |
| 66 | if detail is True: |
| 67 | return CapabilityCheck(name, True, "ok") |
| 68 | if isinstance(detail, str): |
| 69 | return CapabilityCheck(name, False, detail) |
| 70 | return CapabilityCheck(name, False, f"unexpected result {detail!r}") |
| 71 | |
| 72 | |
| 73 | def _build_probe_graph() -> nx.MultiDiGraph: |
no test coverage detected