import asyncio from datetime import datetime from unittest.mock import MagicMock, patch import pytest from litellm.integrations.s3_v2 import S3Logger from litellm.types.utils import StandardLoggingPayload class TestS3V2UnitTests: """Test that S3 v2 integration only uses safe_dumps and not json.dumps""" def test_s3_v2_source_code_analysis(self): """Test that S3 v2 source code only imports and uses safe_dumps""" import inspect from litellm.integrations import s3_v2 # Get the source code of the s3_v2 module source_code = inspect.getsource(s3_v2) # Verify that json.dumps is not used directly in the code assert "json.dumps(" not in source_code, \ "S3 v2 should not use json.dumps directly"