mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-14 00:22:16 +00:00
feat: Add mypy to pre-commit.
This commit is contained in:
committed by
Elisiário Couto
parent
de3da84dff
commit
ec8ef8346a
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user