Build a SimpleNamespace app with the attributes the collector touches. Args: **overrides: App attribute overrides. ``_lifespan_tasks`` is surfaced through a ``get_lifespan_tasks()`` method to match the real API. Returns: A ``SimpleNamespace`` standing in for a c
(**overrides)
| 42 | |
| 43 | |
| 44 | def _fake_app(**overrides): |
| 45 | """Build a SimpleNamespace app with the attributes the collector touches. |
| 46 | |
| 47 | Args: |
| 48 | **overrides: App attribute overrides. ``_lifespan_tasks`` is surfaced |
| 49 | through a ``get_lifespan_tasks()`` method to match the real API. |
| 50 | |
| 51 | Returns: |
| 52 | A ``SimpleNamespace`` standing in for a compiled ``App``. |
| 53 | """ |
| 54 | defaults = { |
| 55 | "_state": None, |
| 56 | "_pages": {}, |
| 57 | "_unevaluated_pages": {}, |
| 58 | } |
| 59 | lifespan_tasks = overrides.pop("_lifespan_tasks", {}) |
| 60 | defaults.update(overrides) |
| 61 | return SimpleNamespace( |
| 62 | get_lifespan_tasks=lambda: tuple(lifespan_tasks), |
| 63 | **defaults, |
| 64 | ) |
| 65 | |
| 66 | |
| 67 | class TelAcctRoot(BaseState): |
no test coverage detected