mirror of
https://github.com/jmagar/unraid-mcp.git
synced 2026-03-23 12:39:24 -07:00
fix(tests): clear subscription_configs before auto-start tests to account for default SNAPSHOT_ACTIONS
This commit is contained in:
@@ -816,6 +816,15 @@ class TestAutoStart:
|
|||||||
|
|
||||||
async def test_auto_start_only_starts_marked_subscriptions(self) -> None:
|
async def test_auto_start_only_starts_marked_subscriptions(self) -> None:
|
||||||
mgr = SubscriptionManager()
|
mgr = SubscriptionManager()
|
||||||
|
# Clear default SNAPSHOT_ACTIONS configs; add one with auto_start=False
|
||||||
|
# to verify that unmarked subscriptions are never started.
|
||||||
|
mgr.subscription_configs.clear()
|
||||||
|
mgr.subscription_configs["no_auto_sub"] = {
|
||||||
|
"query": "subscription { test }",
|
||||||
|
"resource": "unraid://test",
|
||||||
|
"description": "Unmarked sub",
|
||||||
|
"auto_start": False,
|
||||||
|
}
|
||||||
with patch.object(mgr, "start_subscription", new_callable=AsyncMock) as mock_start:
|
with patch.object(mgr, "start_subscription", new_callable=AsyncMock) as mock_start:
|
||||||
await mgr.auto_start_all_subscriptions()
|
await mgr.auto_start_all_subscriptions()
|
||||||
mock_start.assert_not_called()
|
mock_start.assert_not_called()
|
||||||
@@ -837,6 +846,7 @@ class TestAutoStart:
|
|||||||
|
|
||||||
async def test_auto_start_calls_start_for_marked(self) -> None:
|
async def test_auto_start_calls_start_for_marked(self) -> None:
|
||||||
mgr = SubscriptionManager()
|
mgr = SubscriptionManager()
|
||||||
|
mgr.subscription_configs.clear()
|
||||||
mgr.subscription_configs["auto_sub"] = {
|
mgr.subscription_configs["auto_sub"] = {
|
||||||
"query": "subscription { auto }",
|
"query": "subscription { auto }",
|
||||||
"resource": "unraid://auto",
|
"resource": "unraid://auto",
|
||||||
|
|||||||
Reference in New Issue
Block a user