MCPcopy Index your code
hub / github.com/idank/explainshell / _use_store

Function _use_store

tests/test_web_views.py:13–21  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

11
12
13def _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
24def _create_empty_store_file(db_path: Path) -> None:

Callers 6

setUpMethod · 0.85
_make_appMethod · 0.85
setUpMethod · 0.85
setUpMethod · 0.85
setUpMethod · 0.85

Calls 1

distrosMethod · 0.80

Tested by

no test coverage detected