Skip to content

Commit

Permalink
fix: collection and document testing batch
Browse files Browse the repository at this point in the history
  • Loading branch information
rafilong committed Jul 21, 2020
1 parent 0638dd4 commit 68c3d4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/unit/v1/test_async_collection.py
Expand Up @@ -102,7 +102,7 @@ async def test_add_auto_assigned(self):
from google.cloud.firestore_v1._helpers import pbs_for_create

# Create a minimal fake GAPIC add attach it to a real client.
firestore_api = mock.Mock(spec=["create_document", "commit"])
firestore_api = AsyncMock(spec=["create_document", "commit"])
write_result = mock.Mock(
update_time=mock.sentinel.update_time, spec=["update_time"]
)
Expand Down Expand Up @@ -168,7 +168,7 @@ async def test_add_explicit_id(self):
from google.cloud.firestore_v1.async_document import AsyncDocumentReference

# Create a minimal fake GAPIC with a dummy response.
firestore_api = mock.Mock(spec=["commit"])
firestore_api = AsyncMock(spec=["commit"])
write_result = mock.Mock(
update_time=mock.sentinel.update_time, spec=["update_time"]
)
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/v1/test_async_document.py
Expand Up @@ -88,7 +88,7 @@ def _write_pb_for_create(document_path, document_data):
@pytest.mark.asyncio
async def test_create(self):
# Create a minimal fake GAPIC with a dummy response.
firestore_api = mock.Mock()
firestore_api = AsyncMock()
firestore_api.commit.mock_add_spec(spec=["commit"])
firestore_api.commit.return_value = self._make_commit_repsonse()

Expand Down Expand Up @@ -119,7 +119,7 @@ async def test_create_empty(self):
from google.cloud.firestore_v1.async_document import AsyncDocumentReference
from google.cloud.firestore_v1.async_document import DocumentSnapshot

firestore_api = mock.Mock(spec=["commit"])
firestore_api = AsyncMock(spec=["commit"])
document_reference = mock.create_autospec(AsyncDocumentReference)
snapshot = mock.create_autospec(DocumentSnapshot)
snapshot.exists = True
Expand Down Expand Up @@ -169,7 +169,7 @@ def _write_pb_for_set(document_path, document_data, merge):
@pytest.mark.asyncio
async def _set_helper(self, merge=False, **option_kwargs):
# Create a minimal fake GAPIC with a dummy response.
firestore_api = mock.Mock(spec=["commit"])
firestore_api = AsyncMock(spec=["commit"])
firestore_api.commit.return_value = self._make_commit_repsonse()

# Attach the fake GAPIC to a real client.
Expand Down Expand Up @@ -222,7 +222,7 @@ async def _update_helper(self, **option_kwargs):
from google.cloud.firestore_v1.transforms import DELETE_FIELD

# Create a minimal fake GAPIC with a dummy response.
firestore_api = mock.Mock(spec=["commit"])
firestore_api = AsyncMock(spec=["commit"])
firestore_api.commit.return_value = self._make_commit_repsonse()

# Attach the fake GAPIC to a real client.
Expand Down Expand Up @@ -282,7 +282,7 @@ async def test_update_with_precondition(self):
@pytest.mark.asyncio
async def test_empty_update(self):
# Create a minimal fake GAPIC with a dummy response.
firestore_api = mock.Mock(spec=["commit"])
firestore_api = AsyncMock(spec=["commit"])
firestore_api.commit.return_value = self._make_commit_repsonse()

# Attach the fake GAPIC to a real client.
Expand Down

0 comments on commit 68c3d4c

Please sign in to comment.