Skip to content

Commit 6a68726

Browse files
committed
add basic test for client-wide metadata
1 parent eac8310 commit 6a68726

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/api/test_grpc_stub.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,25 @@ async def test_grpc_metadata():
150150
}
151151
)
152152

153+
# Binary metadata should be configurable on the client:
154+
client.rpc_metadata = {
155+
"my-binary-key-bin": b"\x00\x01",
156+
"my-binary-key-bin2": b"\x02\x03",
157+
}
158+
await client.workflow_service.get_system_info(
159+
GetSystemInfoRequest(),
160+
metadata={
161+
"my-binary-key-bin": b"abc",
162+
},
163+
)
164+
workflow_server.assert_last_metadata(
165+
{
166+
"authorization": "Bearer my-api-key",
167+
"my-binary-key-bin": b"abc",
168+
"my-binary-key-bin2": b"\x02\x03",
169+
}
170+
)
171+
153172
# Overwrite API key via client RPC metadata, confirm there
154173
client.rpc_metadata = {
155174
"authorization": "my-auth-val1",

0 commit comments

Comments
 (0)