mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-25 07:07:41 +00:00
ef42461c1e
* test: add __init__.py files * refactor: rename test folder to avoid naming conflict * test: update workflows * test: update tests * test: update imports * test: update tests * test: remove unused import * ci(test-litellm.yml): add pytest retry to github workflow * test: fix test
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
import unittest
|
|
from unittest.mock import patch
|
|
|
|
from litellm.integrations.arize.arize_phoenix import ArizePhoenixLogger
|
|
|
|
|
|
class TestArizePhoenixConfig(unittest.TestCase):
|
|
@patch.dict(
|
|
"os.environ",
|
|
{
|
|
"PHOENIX_API_KEY": "test_api_key",
|
|
"PHOENIX_COLLECTOR_HTTP_ENDPOINT": "http://test.endpoint",
|
|
},
|
|
)
|
|
def test_get_arize_phoenix_config_http(self):
|
|
# Call the function to get the configuration
|
|
config = ArizePhoenixLogger.get_arize_phoenix_config()
|
|
|
|
# Verify the configuration
|
|
self.assertEqual(
|
|
config.otlp_auth_headers, "Authorization=Bearer%20test_api_key"
|
|
)
|
|
self.assertEqual(config.endpoint, "http://test.endpoint")
|
|
self.assertEqual(config.protocol, "otlp_http")
|
|
|
|
@patch.dict(
|
|
"os.environ",
|
|
{
|
|
"PHOENIX_API_KEY": "test_api_key",
|
|
"PHOENIX_COLLECTOR_ENDPOINT": "grpc://test.endpoint",
|
|
},
|
|
)
|
|
def test_get_arize_phoenix_config_grpc(self):
|
|
# Call the function to get the configuration
|
|
config = ArizePhoenixLogger.get_arize_phoenix_config()
|
|
|
|
# Verify the configuration
|
|
self.assertEqual(
|
|
config.otlp_auth_headers, "Authorization=Bearer%20test_api_key"
|
|
)
|
|
self.assertEqual(config.endpoint, "grpc://test.endpoint")
|
|
self.assertEqual(config.protocol, "otlp_grpc")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|