Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,7 @@ async def cancel_operation(
metadata=metadata,
)

async def __aenter__(self):
async def __aenter__(self) -> "FirestoreAdminAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2081,7 +2081,7 @@ def __call__(
request_kwargs = json_format.MessageToDict(request)
transcoded_request = path_template.transcode(http_options, **request_kwargs)

body = json.loads(json.dumps(transcoded_request["body"]))
body = json.dumps(transcoded_request["body"])
uri = transcoded_request["uri"]
method = transcoded_request["method"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,7 @@ async def cancel_operation(
metadata=metadata,
)

async def __aenter__(self):
async def __aenter__(self) -> "FirestoreAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2203,7 +2203,7 @@ def __call__(
request_kwargs = json_format.MessageToDict(request)
transcoded_request = path_template.transcode(http_options, **request_kwargs)

body = json.loads(json.dumps(transcoded_request["body"]))
body = json.dumps(transcoded_request["body"])
uri = transcoded_request["uri"]
method = transcoded_request["method"]

Expand Down
12 changes: 8 additions & 4 deletions tests/unit/gapic/firestore_admin_v1/test_firestore_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1374,9 +1374,11 @@ async def test_list_indexes_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_indexes(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down Expand Up @@ -2708,9 +2710,11 @@ async def test_list_fields_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_fields(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down
20 changes: 13 additions & 7 deletions tests/unit/gapic/firestore_v1/test_firestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,9 +1178,11 @@ async def test_list_documents_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_documents(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down Expand Up @@ -3154,9 +3156,11 @@ async def test_partition_query_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.partition_query(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down Expand Up @@ -3742,9 +3746,11 @@ async def test_list_collection_ids_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_collection_ids(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down Expand Up @@ -5150,7 +5156,7 @@ def test_batch_get_documents_rest(request_type):
# Designate an appropriate value for the returned response.
return_value = firestore.BatchGetDocumentsResponse(
transaction=b"transaction_blob",
found=document.Document(name="name_value"),
missing="missing_value",
)

# Wrap the value into a proper Response obj
Expand Down