Skip to content

Commit

Permalink
More test plumbing
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Dec 25, 2024
1 parent 3e47760 commit 07a00f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/unit/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ def test_commit_ok(self):
[
("google-cloud-resource-prefix", database.name),
("x-goog-spanner-route-to-leader", "true"),
(
"x-goog-spanner-request-id",
f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.1.1.1",
)
],
)
self.assertEqual(request_options, RequestOptions())
Expand Down Expand Up @@ -577,6 +581,10 @@ def _test_batch_write_with_request_options(
[
("google-cloud-resource-prefix", database.name),
("x-goog-spanner-route-to-leader", "true"),
(
"x-goog-spanner-request-id",
f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.1.1.1",
),
],
)
if request_options is None:
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ def _execute_partitioned_dml_helper(
("x-goog-spanner-route-to-leader", "true"),
(
"x-goog-spanner-request-id",
f"1.{REQ_RAND_PROCESS_ID}.{_Client.NTH_CLIENT.value}.1.1.1",
f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.{database._channel_id}.1.1",
),
],
)
Expand Down Expand Up @@ -3217,6 +3217,7 @@ def __init__(
self.directed_read_options = directed_read_options
self._nth_client_id = _Client.NTH_CLIENT.increment()
self._nth_request = AtomicCounter()
self.credentials = {}

@property
def _next_nth_request(self):
Expand Down

0 comments on commit 07a00f9

Please sign in to comment.