mirror of
https://github.com/jmagar/unraid-mcp.git
synced 2026-03-23 12:39:24 -07:00
fix(notifications): remove warnings action (warningsAndAlerts not in live API)
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
"""Tests for unraid_notifications tool."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from typing import get_args
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
from conftest import make_tool_fn
|
||||
|
||||
from unraid_mcp.core.exceptions import ToolError
|
||||
from unraid_mcp.tools.notifications import NOTIFICATION_ACTIONS
|
||||
|
||||
|
||||
def test_warnings_action_removed() -> None:
|
||||
assert "warnings" not in get_args(NOTIFICATION_ACTIONS), (
|
||||
"warnings action references warningsAndAlerts which is not in live API"
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -72,14 +80,6 @@ class TestNotificationsActions:
|
||||
result = await tool_fn(action="list")
|
||||
assert len(result["notifications"]) == 1
|
||||
|
||||
async def test_warnings(self, _mock_graphql: AsyncMock) -> None:
|
||||
_mock_graphql.return_value = {
|
||||
"notifications": {"warningsAndAlerts": [{"id": "n:1", "importance": "WARNING"}]}
|
||||
}
|
||||
tool_fn = _make_tool()
|
||||
result = await tool_fn(action="warnings")
|
||||
assert len(result["warnings"]) == 1
|
||||
|
||||
async def test_create(self, _mock_graphql: AsyncMock) -> None:
|
||||
_mock_graphql.return_value = {
|
||||
"createNotification": {"id": "n:new", "title": "Test", "importance": "INFO"}
|
||||
|
||||
Reference in New Issue
Block a user