File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/common Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 1+ # Copyright The OpenTelemetry Authors
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ import google .auth
16+
17+ class FakeCredentials (google .auth .credentials .AnonymousCredentials ):
18+
19+ def refresh (self , request ):
20+ pass
Original file line number Diff line number Diff line change 1717
1818import google .genai
1919
20+ from .auth import FakeCredentials
2021from .instrumentation_context import InstrumentationContext
2122from .otel_mocker import OTelMocker
2223
2324
24- class _FakeCredentials (google .auth .credentials .AnonymousCredentials ):
25- def refresh (self , request ):
26- pass
27-
28-
2925class TestCase (unittest .TestCase ):
3026 def setUp (self ):
3127 self ._otel = OTelMocker ()
@@ -36,7 +32,7 @@ def setUp(self):
3632 self ._location = "test-location"
3733 self ._client = None
3834 self ._uses_vertex = False
39- self ._credentials = _FakeCredentials ()
35+ self ._credentials = FakeCredentials ()
4036
4137 def _lazy_init (self ):
4238 self ._instrumentation_context = InstrumentationContext ()
You can’t perform that action at this time.
0 commit comments