Spaces:
Sleeping
Sleeping
Download tests/unit/utils/test_exceptions.py from MCP-1st-Birthday/DeepBoner: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/MCP-1st-Birthday/DeepBoner/resolve/main/tests/unit/utils/test_exceptions.py
- Command line
-
hf download hf://spaces/MCP-1st-Birthday/DeepBoner/tests/unit/utils/test_exceptions.py
-
curl -L -o test_exceptions.py https://huggingface.co/spaces/MCP-1st-Birthday/DeepBoner/resolve/main/tests/unit/utils/test_exceptions.py
1.04 kB
| """Unit tests for custom exceptions.""" | |
| import pytest | |
| pytestmark = pytest.mark.unit | |
| from src.utils.exceptions import ( | |
| ConfigurationError, | |
| DeepBonerError, | |
| JudgeError, | |
| RateLimitError, | |
| SearchError, | |
| ) | |
| class TestExceptions: | |
| """Tests for exception hierarchy.""" | |
| def test_search_error_is_deepboner_error(self): | |
| assert issubclass(SearchError, DeepBonerError) | |
| def test_rate_limit_error_is_search_error(self): | |
| assert issubclass(RateLimitError, SearchError) | |
| def test_judge_error_is_deepboner_error(self): | |
| assert issubclass(JudgeError, DeepBonerError) | |
| def test_configuration_error_is_deepboner_error(self): | |
| assert issubclass(ConfigurationError, DeepBonerError) | |
| def test_subclass_caught_as_base(self): | |
| """Verify subclasses can be caught via DeepBonerError.""" | |
| try: | |
| raise RateLimitError("rate limited") | |
| except DeepBonerError as exc: | |
| assert isinstance(exc, RateLimitError) | |
| assert isinstance(exc, DeepBonerError) | |