mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-14 09:51:25 -06:00
Copybara import of the project:
-- 0723b0915550a0af9d1eb2952ee193238eee8178 by Thiago Neves <thiagohneves@gmail.com>: fix(tests): use mock GCS client in artifact service tests to avoid real credentials COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/601 from thiagoneves:fix/mock-gcs-client-in-tests e7d16719b9c3116b652988d2ed1b1f8893686f3e PiperOrigin-RevId: 756381115
This commit is contained in:
parent
85ccacbf2d
commit
5fd6a448de
@ -21,6 +21,8 @@ from typing import Union
|
||||
from google.adk.artifacts import GcsArtifactService
|
||||
from google.adk.artifacts import InMemoryArtifactService
|
||||
from google.genai import types
|
||||
|
||||
from unittest import mock
|
||||
import pytest
|
||||
|
||||
Enum = enum.Enum
|
||||
@ -136,11 +138,10 @@ class MockClient:
|
||||
|
||||
|
||||
def mock_gcs_artifact_service():
|
||||
"""Creates a mock GCS artifact service for testing."""
|
||||
service = GcsArtifactService(bucket_name="test_bucket")
|
||||
service.storage_client = MockClient()
|
||||
service.bucket = service.storage_client.bucket("test_bucket")
|
||||
return service
|
||||
with mock.patch("google.cloud.storage.Client", return_value=MockClient()):
|
||||
service = GcsArtifactService(bucket_name="test_bucket")
|
||||
service.bucket = service.storage_client.bucket("test_bucket")
|
||||
return service
|
||||
|
||||
|
||||
def get_artifact_service(
|
||||
|
Loading…
Reference in New Issue
Block a user