Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 97b0152

Browse files
committed
tests
1 parent 44e0104 commit 97b0152

File tree

3 files changed

+149
-219
lines changed

3 files changed

+149
-219
lines changed

tests/unit/test_batch.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def _test_commit_with_options(
292292
request_options=None,
293293
max_commit_delay_in=None,
294294
exclude_txn_from_change_streams=False,
295-
isolation_level=None,
295+
isolation_level=TransactionOptions.IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED,
296296
):
297297
now = datetime.datetime.utcnow().replace(tzinfo=UTC)
298298
now_pb = _datetime_to_pb_timestamp(now)
@@ -307,6 +307,7 @@ def _test_commit_with_options(
307307
request_options=request_options,
308308
max_commit_delay=max_commit_delay_in,
309309
exclude_txn_from_change_streams=exclude_txn_from_change_streams,
310+
isolation_level=isolation_level,
310311
)
311312

312313
self.assertEqual(committed, now)
@@ -335,6 +336,10 @@ def _test_commit_with_options(
335336
single_use_txn.exclude_txn_from_change_streams,
336337
exclude_txn_from_change_streams,
337338
)
339+
self.assertEqual(
340+
single_use_txn.isolation_level,
341+
isolation_level,
342+
)
338343
self.assertEqual(
339344
metadata,
340345
[
@@ -396,6 +401,15 @@ def test_commit_w_exclude_txn_from_change_streams(self):
396401
request_options=request_options, exclude_txn_from_change_streams=True
397402
)
398403

404+
def test_commit_w_isolation_level(self):
405+
request_options = RequestOptions(
406+
request_tag="tag-1",
407+
)
408+
self._test_commit_with_options(
409+
request_options=request_options,
410+
isolation_level=TransactionOptions.IsolationLevel.REPEATABLE_READ,
411+
)
412+
399413
def test_context_mgr_already_committed(self):
400414
now = datetime.datetime.utcnow().replace(tzinfo=UTC)
401415
database = _Database()

0 commit comments

Comments
 (0)