Inject *store* into Flask's app extensions so ``get_store()`` returns it instead of opening a real database. Also refreshes ``STARTUP_DISTROS`` from *store* so ``get_distros()`` reflects the test fixture.
(app: object, store: Store)
| 11 | |
| 12 | |
| 13 | def _use_store(app: object, store: Store) -> None: |
| 14 | """Inject *store* into Flask's app extensions so ``get_store()`` returns it |
| 15 | instead of opening a real database. |
| 16 | |
| 17 | Also refreshes ``STARTUP_DISTROS`` from *store* so ``get_distros()`` |
| 18 | reflects the test fixture. |
| 19 | """ |
| 20 | app.extensions[STORE_EXTENSION_KEY] = store |
| 21 | app.config["STARTUP_DISTROS"] = list(store.distros()) |
| 22 | |
| 23 | |
| 24 | def _create_empty_store_file(db_path: Path) -> None: |