Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit485a7d7

Browse files
committed
for testing purposes
1 parent1ca7973 commit485a7d7

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

‎google/api_core/client_info.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class ClientInfo(object):
5959
Recommended format: ``application-or-tool-ID/major.minor.version``.
6060
rest_version (Optional[str]): A string with labeled versions of the
6161
dependencies used for REST transport.
62+
protobuf_runtime_version (Optional[str]): The protobuf runtime version.
6263
"""
6364

6465
def__init__(
@@ -70,6 +71,7 @@ def __init__(
7071
client_library_version=None,
7172
user_agent=None,
7273
rest_version=None,
74+
protobuf_runtime_version=None
7375
):
7476
self.python_version=python_version
7577
self.grpc_version=grpc_version
@@ -78,6 +80,7 @@ def __init__(
7880
self.client_library_version=client_library_version
7981
self.user_agent=user_agent
8082
self.rest_version=rest_version
83+
self.protobuf_runtime_version=protobuf_runtime_version
8184

8285
defto_user_agent(self):
8386
"""Returns the user-agent string for this client info."""
@@ -105,4 +108,7 @@ def to_user_agent(self):
105108
ifself.client_library_versionisnotNone:
106109
ua+="gccl/{client_library_version} "
107110

111+
ifself.protobuf_runtime_versionisnotNone:
112+
ua+="protobuf/{protobuf_runtime_version} "
113+
108114
returnua.format(**self.__dict__).strip()

‎google/api_core/gapic_v1/client_info.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class ClientInfo(client_info.ClientInfo):
4747
Recommended format: ``application-or-tool-ID/major.minor.version``.
4848
rest_version (Optional[str]): A string with labeled versions of the
4949
dependencies used for REST transport.
50+
protobuf_runtime_version (Optional[str]): The protobuf runtime version.
5051
"""
5152

5253
defto_grpc_metadata(self):

‎tests/asyncio/gapic/test_method_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ async def test_wrap_method_with_custom_client_info():
8181
api_core_version=3,
8282
gapic_version=4,
8383
client_library_version=5,
84+
protobuf_runtime_version=6,
8485
)
8586
fake_call=grpc_helpers_async.FakeUnaryUnaryCall()
8687
method=mock.Mock(spec=aio.UnaryUnaryMultiCallable,return_value=fake_call)

‎tests/unit/gapic/test_method.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def test_wrap_method_with_custom_client_info():
7676
api_core_version=3,
7777
gapic_version=4,
7878
client_library_version=5,
79+
protobuf_runtime_version=6
7980
)
8081
method=mock.Mock(spec=["__call__"])
8182

‎tests/unit/test_client_info.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def test_constructor_options():
4646
client_library_version="5",
4747
user_agent="6",
4848
rest_version="7",
49+
protobuf_runtime_version="8",
4950
)
5051

5152
assertinfo.python_version=="1"
@@ -55,11 +56,12 @@ def test_constructor_options():
5556
assertinfo.client_library_version=="5"
5657
assertinfo.user_agent=="6"
5758
assertinfo.rest_version=="7"
59+
assertinfo.protobuf_runtime_version=="8"
5860

5961

6062
deftest_to_user_agent_minimal():
6163
info=client_info.ClientInfo(
62-
python_version="1",api_core_version="2",grpc_version=None
64+
python_version="1",api_core_version="2",grpc_version=None,protobuf_runtime_version=None,
6365
)
6466

6567
user_agent=info.to_user_agent()
@@ -75,11 +77,12 @@ def test_to_user_agent_full():
7577
gapic_version="4",
7678
client_library_version="5",
7779
user_agent="app-name/1.0",
80+
protobuf_runtime_version="6",
7881
)
7982

8083
user_agent=info.to_user_agent()
8184

82-
assertuser_agent=="app-name/1.0 gl-python/1 grpc/2 gax/3 gapic/4 gccl/5"
85+
assertuser_agent=="app-name/1.0 gl-python/1 grpc/2 gax/3 gapic/4 gccl/5 protobuf/6"
8386

8487

8588
deftest_to_user_agent_rest():

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp