1818from google .cloud .firestore_v1 import pipeline_stages as stages
1919from google .cloud .firestore_v1 .pipeline_expressions import Field
2020
21+ from tests .unit .v1 ._test_helpers import make_async_client
22+
2123
2224def _make_async_pipeline (* args , client = mock .Mock ()):
2325 from google .cloud .firestore_v1 .async_pipeline import AsyncPipeline
@@ -189,11 +191,10 @@ async def test_async_pipeline_stream_populated():
189191 from google .cloud .firestore_v1 .types import ExecutePipelineResponse
190192 from google .cloud .firestore_v1 .types import ExecutePipelineRequest
191193 from google .cloud .firestore_v1 .types import Value
192- from google .cloud .firestore_v1 .client import Client
193- from google .cloud .firestore_v1 .document import DocumentReference
194+ from google .cloud .firestore_v1 .async_document import AsyncDocumentReference
194195 from google .cloud .firestore_v1 .pipeline_result import PipelineResult
195196
196- real_client = Client ()
197+ real_client = make_async_client ()
197198 client = mock .Mock ()
198199 client .project = "A"
199200 client ._database = "B"
@@ -228,7 +229,7 @@ async def test_async_pipeline_stream_populated():
228229
229230 response = results [0 ]
230231 assert isinstance (response , PipelineResult )
231- assert isinstance (response .ref , DocumentReference )
232+ assert isinstance (response .ref , AsyncDocumentReference )
232233 assert response .ref .path == "test/my_doc"
233234 assert response .id == "my_doc"
234235 assert response .create_time .seconds == 1
@@ -246,10 +247,9 @@ async def test_async_pipeline_stream_multiple():
246247 from google .cloud .firestore_v1 .types import ExecutePipelineResponse
247248 from google .cloud .firestore_v1 .types import ExecutePipelineRequest
248249 from google .cloud .firestore_v1 .types import Value
249- from google .cloud .firestore_v1 .client import Client
250250 from google .cloud .firestore_v1 .pipeline_result import PipelineResult
251251
252- real_client = Client ()
252+ real_client = make_async_client ()
253253 client = mock .Mock ()
254254 client .project = "A"
255255 client ._database = "B"
@@ -358,9 +358,8 @@ async def test_async_pipeline_stream_stream_equivalence():
358358 from google .cloud .firestore_v1 .types import Document
359359 from google .cloud .firestore_v1 .types import ExecutePipelineResponse
360360 from google .cloud .firestore_v1 .types import Value
361- from google .cloud .firestore_v1 .client import Client
362361
363- real_client = Client ()
362+ real_client = make_async_client ()
364363 client = mock .Mock ()
365364 client .project = "A"
366365 client ._database = "B"
0 commit comments