Fix tests after refactor

This commit is contained in:
Pim van Pelt
2025-08-03 11:43:53 +02:00
parent f1d10458c6
commit 64e1ca124f
5 changed files with 60 additions and 48 deletions

View File

@@ -49,8 +49,10 @@ class TestInfoCommands:
def test_get_info_api_error(self, mock_client, capsys):
"""Test info command with API error"""
from uptime_kuma_api import UptimeKumaException
# Setup
mock_client.api.info.side_effect = Exception("Connection failed")
mock_client.api.info.side_effect = UptimeKumaException("Connection failed")
info_commands = InfoCommands(mock_client)
@@ -80,9 +82,11 @@ class TestInfoCommandHandler:
def test_handle_info_command_with_error(self, mock_client):
"""Test info command handler with error"""
from uptime_kuma_api import UptimeKumaException
# Setup
mock_args = Mock()
mock_client.api.info.side_effect = Exception("API Error")
mock_client.api.info.side_effect = UptimeKumaException("API Error")
# Execute
result = handle_info_command(mock_args, mock_client)