feat: Add mypy to pre-commit.

This commit is contained in:
Elisiário Couto
2025-09-03 21:40:15 +01:00
committed by Elisiário Couto
parent de3da84dff
commit ec8ef8346a
34 changed files with 226 additions and 242 deletions

View File

@@ -1,6 +1,7 @@
"""Tests for CLI API client."""
import pytest
import requests
import requests_mock
from unittest.mock import patch
@@ -85,7 +86,7 @@ class TestLeggendAPIClient:
"""Test handling of connection errors."""
client = LeggendAPIClient("http://localhost:9999") # Non-existent service
with pytest.raises(Exception):
with pytest.raises((requests.ConnectionError, requests.RequestException)):
client.get_accounts()
def test_http_error_handling(self):
@@ -99,7 +100,7 @@ class TestLeggendAPIClient:
json={"detail": "Internal server error"},
)
with pytest.raises(Exception):
with pytest.raises((requests.HTTPError, requests.RequestException)):
client.get_accounts()
def test_custom_api_url(self):