FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-spanner/samples/samples/autocommit_test.py at main · classicvalues/python-spanner · GitHub
classicvalues
/
python-spanner
Public
forked from
googleapis/python-spanner
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
2
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-spanner
/
samples
/
samples
/
autocommit_test.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (25 loc) · 964 Bytes
Breadcrumbs
python-spanner
/
samples
/
samples
/
autocommit_test.py
Copy path
File metadata and controls
32 lines (25 loc) · 964 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Copyright 2020 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
from
google
.
api_core
.
exceptions
import
Aborted
import
pytest
from
test_utils
.
retry
import
RetryErrors
import
autocommit
@
pytest
.
fixture
(
scope
=
"module"
)
def
sample_name
():
return
"autocommit"
@
RetryErrors
(
exception
=
Aborted
,
max_tries
=
2
)
def
test_enable_autocommit_mode
(
capsys
,
instance_id
,
sample_database
):
# Delete table if it exists for retry attempts.
table
=
sample_database
.
table
(
'Singers'
)
if
table
.
exists
():
op
=
sample_database
.
update_ddl
([
"DROP TABLE Singers"
])
op
.
result
()
autocommit
.
enable_autocommit_mode
(
instance_id
,
sample_database
.
database_id
,
)
out
,
_
=
capsys
.
readouterr
()
assert
"Autocommit mode is enabled."
in
out
assert
"SingerId: 13, AlbumId: Russell, AlbumTitle: Morales"
in
out
Back
|
FazBrowse Home
|
New Git URL