@@ -203,12 +203,12 @@ def _make_mock_client():
203203 return mock .create_autospec (big_query_write .BigQueryWriteClient )
204204
205205 @staticmethod
206- def _make_mock_stream ():
206+ def _make_mock_stream (initial_template = REQUEST_TEMPLATE ):
207207 from google .cloud .bigquery_storage_v1 .writer import _process_request_template
208208
209209 writer = mock .Mock ()
210210 template = mock .PropertyMock (
211- return_value = _process_request_template (REQUEST_TEMPLATE )
211+ return_value = _process_request_template (initial_template )
212212 )
213213 type(writer )._initial_request_template = template
214214 return writer
@@ -251,8 +251,17 @@ def test_is_active(self):
251251 def test_initial_send (self , background_consumer , bidi_rpc ):
252252 from google .cloud .bigquery_storage_v1 .writer import AppendRowsFuture
253253
254+ initial_request_template = gapic_types .AppendRowsRequest (
255+ write_stream = "stream-name-from-REQUEST_TEMPLATE" ,
256+ offset = 0 ,
257+ proto_rows = gapic_types .AppendRowsRequest .ProtoData (
258+ writer_schema = gapic_types .ProtoSchema (
259+ proto_descriptor = descriptor_pb2 .DescriptorProto ()
260+ )
261+ ),
262+ )
254263 mock_client = self ._make_mock_client ()
255- mock_stream = self ._make_mock_stream ()
264+ mock_stream = self ._make_mock_stream (initial_template = initial_request_template )
256265 connection = self ._make_one (mock_client , mock_stream )
257266
258267 type(bidi_rpc .return_value ).is_active = mock .PropertyMock (
0 commit comments