mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-29 12:35:13 +00:00
fix(api): stop serve cleanly with jobs, streams and remote sessions open
This commit is contained in:
@@ -134,6 +134,19 @@ async def test_cancel_all_bridges(store: SessionStore) -> None:
|
||||
entry.input_bridge.ensure_active()
|
||||
|
||||
|
||||
async def test_cancel_all_bridges_removes_the_session_cache_dirs(
|
||||
store: SessionStore, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
removed: list = []
|
||||
monkeypatch.setattr(SessionStore, "cleanup_cache_dir", staticmethod(removed.append))
|
||||
entry = await store.create("EXAMPLE", _FakeService(), cache_tag="_sessions/k/s/EXAMPLE")
|
||||
await store.create("OTHER", _FakeService())
|
||||
|
||||
await store.cancel_all_bridges()
|
||||
assert removed == [entry.cache_tag, None]
|
||||
assert store.session_count == 0
|
||||
|
||||
|
||||
async def test_get_session_store_returns_singleton() -> None:
|
||||
a = get_session_store()
|
||||
b = get_session_store()
|
||||
|
||||
Reference in New Issue
Block a user