Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
a08c4728
Commit
a08c4728
authored
Feb 09, 2017
by
Jim Fulton
Committed by
GitHub
Feb 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #141 from zopefoundation/issue-138
TransactionUndoStorage tests close the conn and db
parents
a97ca02f
d4d74383
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
165 additions
and
146 deletions
+165
-146
.travis.yml
.travis.yml
+1
-1
src/ZODB/tests/TransactionalUndoStorage.py
src/ZODB/tests/TransactionalUndoStorage.py
+164
-145
No files found.
.travis.yml
View file @
a08c4728
...
@@ -3,7 +3,7 @@ sudo: false
...
@@ -3,7 +3,7 @@ sudo: false
matrix
:
matrix
:
include
:
include
:
-
os
:
linux
-
os
:
linux
python
:
pypy
python
:
pypy
-5.4.1
-
os
:
linux
-
os
:
linux
python
:
pypy3
python
:
pypy3
env
:
BUILOUT_OPTIONS=sphinx:eggs=
env
:
BUILOUT_OPTIONS=sphinx:eggs=
...
...
src/ZODB/tests/TransactionalUndoStorage.py
View file @
a08c4728
...
@@ -407,6 +407,7 @@ class TransactionalUndoStorage:
...
@@ -407,6 +407,7 @@ class TransactionalUndoStorage:
eq
=
self
.
assertEqual
eq
=
self
.
assertEqual
db
=
DB
(
self
.
_storage
)
db
=
DB
(
self
.
_storage
)
conn
=
db
.
open
()
conn
=
db
.
open
()
try
:
root
=
conn
.
root
()
root
=
conn
.
root
()
o1
=
C
()
o1
=
C
()
...
@@ -458,10 +459,14 @@ class TransactionalUndoStorage:
...
@@ -458,10 +459,14 @@ class TransactionalUndoStorage:
eq
(
o1
.
obj
,
o2
)
eq
(
o1
.
obj
,
o2
)
eq
(
o1
.
obj
.
obj
,
o3
)
eq
(
o1
.
obj
.
obj
,
o3
)
self
.
_iterate
()
self
.
_iterate
()
finally
:
conn
.
close
()
db
.
close
()
def
checkPackAfterUndoDeletion
(
self
):
def
checkPackAfterUndoDeletion
(
self
):
db
=
DB
(
self
.
_storage
)
db
=
DB
(
self
.
_storage
)
cn
=
db
.
open
()
cn
=
db
.
open
()
try
:
root
=
cn
.
root
()
root
=
cn
.
root
()
pack_times
=
[]
pack_times
=
[]
...
@@ -512,10 +517,15 @@ class TransactionalUndoStorage:
...
@@ -512,10 +517,15 @@ class TransactionalUndoStorage:
self
.
assertEqual
(
obj
.
value
,
i
)
self
.
assertEqual
(
obj
.
value
,
i
)
root
.
items
()
root
.
items
()
self
.
_inter_pack_pause
()
self
.
_inter_pack_pause
()
finally
:
cn
.
close
()
db
.
close
()
def
checkPackAfterUndoManyTimes
(
self
):
def
checkPackAfterUndoManyTimes
(
self
):
db
=
DB
(
self
.
_storage
)
db
=
DB
(
self
.
_storage
)
cn
=
db
.
open
()
cn
=
db
.
open
()
try
:
rt
=
cn
.
root
()
rt
=
cn
.
root
()
rt
[
"test"
]
=
MinPO
(
1
)
rt
[
"test"
]
=
MinPO
(
1
)
...
@@ -555,6 +565,9 @@ class TransactionalUndoStorage:
...
@@ -555,6 +565,9 @@ class TransactionalUndoStorage:
self
.
assertEqual
(
rt
[
"test"
].
value
,
3
)
self
.
assertEqual
(
rt
[
"test"
].
value
,
3
)
self
.
assertEqual
(
rt
[
"test2"
].
value
,
2
)
self
.
assertEqual
(
rt
[
"test2"
].
value
,
2
)
self
.
_inter_pack_pause
()
self
.
_inter_pack_pause
()
finally
:
cn
.
close
()
db
.
close
()
def
_inter_pack_pause
(
self
):
def
_inter_pack_pause
(
self
):
# DirectoryStorage needs a pause between packs,
# DirectoryStorage needs a pause between packs,
...
@@ -654,6 +667,7 @@ class TransactionalUndoStorage:
...
@@ -654,6 +667,7 @@ class TransactionalUndoStorage:
t
.
setUser
(
u'u3'
,
path
=
u'p3'
)
t
.
setUser
(
u'u3'
,
path
=
u'p3'
)
db
=
DB
(
self
.
_storage
)
db
=
DB
(
self
.
_storage
)
conn
=
db
.
open
()
conn
=
db
.
open
()
try
:
root
=
conn
.
root
()
root
=
conn
.
root
()
o1
=
C
()
o1
=
C
()
root
[
'obj'
]
=
o1
root
[
'obj'
]
=
o1
...
@@ -665,6 +679,9 @@ class TransactionalUndoStorage:
...
@@ -665,6 +679,9 @@ class TransactionalUndoStorage:
self
.
assertEqual
(
d
[
'description'
],
b't1'
)
self
.
assertEqual
(
d
[
'description'
],
b't1'
)
self
.
assertEqual
(
d
[
'k2'
],
'this is transaction metadata'
)
self
.
assertEqual
(
d
[
'k2'
],
'this is transaction metadata'
)
self
.
assertEqual
(
d
[
'user_name'
],
b'p3 u3'
)
self
.
assertEqual
(
d
[
'user_name'
],
b'p3 u3'
)
finally
:
conn
.
close
()
db
.
close
()
# A common test body for index tests on undoInfo and undoLog. Before
# A common test body for index tests on undoInfo and undoLog. Before
# ZODB 3.4, they always returned a wrong number of results (one too
# ZODB 3.4, they always returned a wrong number of results (one too
...
@@ -729,8 +746,8 @@ class TransactionalUndoStorage:
...
@@ -729,8 +746,8 @@ class TransactionalUndoStorage:
def
checkUndoMultipleConflictResolution
(
self
,
reverse
=
False
):
def
checkUndoMultipleConflictResolution
(
self
,
reverse
=
False
):
from
.ConflictResolution
import
PCounter
from
.ConflictResolution
import
PCounter
db
=
DB
(
self
.
_storage
)
db
=
DB
(
self
.
_storage
)
cn
=
db
.
open
()
cn
=
db
.
open
()
try
:
cn
.
root
.
x
=
PCounter
()
cn
.
root
.
x
=
PCounter
()
transaction
.
commit
()
transaction
.
commit
()
...
@@ -748,7 +765,9 @@ class TransactionalUndoStorage:
...
@@ -748,7 +765,9 @@ class TransactionalUndoStorage:
transaction
.
commit
()
transaction
.
commit
()
self
.
assertEqual
(
cn
.
root
.
x
.
_value
,
2
)
self
.
assertEqual
(
cn
.
root
.
x
.
_value
,
2
)
finally
:
cn
.
close
()
cn
.
close
()
db
.
close
()
def
checkUndoMultipleConflictResolutionReversed
(
self
):
def
checkUndoMultipleConflictResolutionReversed
(
self
):
self
.
checkUndoMultipleConflictResolution
(
True
)
self
.
checkUndoMultipleConflictResolution
(
True
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment