@@ -36,10 +36,11 @@ async def test_get_operation():
36
36
operations_pb2 .Operation (name = "meep" ))
37
37
client = operations_v1 .OperationsAsyncClient (mocked_channel )
38
38
39
- response = await client .get_operation ("name" , metadata = [("x-goog-request-params " , "foo" )])
39
+ response = await client .get_operation ("name" , metadata = [("header " , "foo" )])
40
40
assert method .call_count == 1
41
41
assert tuple (method .call_args_list [0 ])[0 ][0 ].name == "name"
42
- assert ("x-goog-request-params" , "foo" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
42
+ assert ("header" , "foo" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
43
+ assert ("x-goog-request-params" , "name=name" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
43
44
assert response == fake_call .response
44
45
45
46
@@ -54,7 +55,7 @@ async def test_list_operations():
54
55
mocked_channel , method , fake_call = _mock_grpc_objects (list_response )
55
56
client = operations_v1 .OperationsAsyncClient (mocked_channel )
56
57
57
- pager = await client .list_operations ("name" , "filter" , metadata = [("x-goog-request-params " , "foo" )])
58
+ pager = await client .list_operations ("name" , "filter" , metadata = [("header " , "foo" )])
58
59
59
60
assert isinstance (pager , page_iterator_async .AsyncIterator )
60
61
responses = []
@@ -64,7 +65,8 @@ async def test_list_operations():
64
65
assert responses == operations
65
66
66
67
assert method .call_count == 1
67
- assert ("x-goog-request-params" , "foo" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
68
+ assert ("header" , "foo" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
69
+ assert ("x-goog-request-params" , "name=name" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
68
70
request = tuple (method .call_args_list [0 ])[0 ][0 ]
69
71
assert isinstance (request , operations_pb2 .ListOperationsRequest )
70
72
assert request .name == "name"
@@ -77,11 +79,12 @@ async def test_delete_operation():
77
79
empty_pb2 .Empty ())
78
80
client = operations_v1 .OperationsAsyncClient (mocked_channel )
79
81
80
- await client .delete_operation ("name" , metadata = [("x-goog-request-params " , "foo" )])
82
+ await client .delete_operation ("name" , metadata = [("header " , "foo" )])
81
83
82
84
assert method .call_count == 1
83
85
assert tuple (method .call_args_list [0 ])[0 ][0 ].name == "name"
84
- assert ("x-goog-request-params" , "foo" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
86
+ assert ("header" , "foo" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
87
+ assert ("x-goog-request-params" , "name=name" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
85
88
86
89
87
90
@pytest .mark .asyncio
@@ -90,8 +93,9 @@ async def test_cancel_operation():
90
93
empty_pb2 .Empty ())
91
94
client = operations_v1 .OperationsAsyncClient (mocked_channel )
92
95
93
- await client .cancel_operation ("name" , metadata = [("x-goog-request-params " , "foo" )])
96
+ await client .cancel_operation ("name" , metadata = [("header " , "foo" )])
94
97
95
98
assert method .call_count == 1
96
99
assert tuple (method .call_args_list [0 ])[0 ][0 ].name == "name"
97
- assert ("x-goog-request-params" , "foo" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
100
+ assert ("header" , "foo" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
101
+ assert ("x-goog-request-params" , "name=name" ) in tuple (method .call_args_list [0 ])[1 ]["metadata" ]
0 commit comments