mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
59da578902
* [Py Purview] Purview Python Initial Commit * [Py Purview] Purview Python Minor Fixes * [Py Purview] Purview Python Comment Fixesish * [Py Purview] Purview Python Agent Middleware Done * [Py Purview] Purview Python Agent Middleware Done * [Py Purview] Purview Python Lint Errors * [Py Purview] Purview Python Final Hopefully * [Py Purview] Purview Python Final Hopefully * [Py Purview] Purview Python Fix ReadMe * [Py Purview] Purview Python Fix MyPy * [Py Purview] Purview Python Minor Updates on comments * [Py Purview] Purview Python Fix Build Error --------- Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
# Copyright (c) Microsoft. All rights reserved.
|
|
|
|
"""Tests for Purview exceptions."""
|
|
|
|
from agent_framework_purview import (
|
|
PurviewAuthenticationError,
|
|
PurviewRateLimitError,
|
|
PurviewRequestError,
|
|
PurviewServiceError,
|
|
)
|
|
|
|
|
|
class TestPurviewExceptions:
|
|
"""Test custom Purview exception classes."""
|
|
|
|
def test_purview_service_error(self) -> None:
|
|
"""Test PurviewServiceError base exception."""
|
|
error = PurviewServiceError("Service error occurred")
|
|
assert str(error) == "Service error occurred"
|
|
assert isinstance(error, Exception)
|
|
|
|
def test_purview_authentication_error(self) -> None:
|
|
"""Test PurviewAuthenticationError exception."""
|
|
error = PurviewAuthenticationError("Authentication failed")
|
|
assert str(error) == "Authentication failed"
|
|
assert isinstance(error, PurviewServiceError)
|
|
|
|
def test_purview_rate_limit_error(self) -> None:
|
|
"""Test PurviewRateLimitError exception."""
|
|
error = PurviewRateLimitError("Rate limit exceeded")
|
|
assert str(error) == "Rate limit exceeded"
|
|
assert isinstance(error, PurviewServiceError)
|
|
|
|
def test_purview_request_error(self) -> None:
|
|
"""Test PurviewRequestError exception."""
|
|
error = PurviewRequestError("Request failed")
|
|
assert str(error) == "Request failed"
|
|
assert isinstance(error, PurviewServiceError)
|