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
49919d31
Commit
49919d31
authored
Feb 03, 2014
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test for POSKeyError during transaction commit
see
https://github.com/zopefoundation/ZODB/issues/16
parent
41908b25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
src/ZODB/tests/testZODB.py
src/ZODB/tests/testZODB.py
+34
-0
No files found.
src/ZODB/tests/testZODB.py
View file @
49919d31
...
@@ -17,6 +17,8 @@ from persistent.mapping import PersistentMapping
...
@@ -17,6 +17,8 @@ from persistent.mapping import PersistentMapping
from
ZODB.POSException
import
ReadConflictError
from
ZODB.POSException
import
ReadConflictError
from
ZODB.POSException
import
TransactionFailedError
from
ZODB.POSException
import
TransactionFailedError
import
Acquisition
from
BTrees.OOBTree
import
OOBTree
import
transaction
import
transaction
import
unittest
import
unittest
import
ZODB
import
ZODB
...
@@ -24,9 +26,19 @@ import ZODB.FileStorage
...
@@ -24,9 +26,19 @@ import ZODB.FileStorage
import
ZODB.MappingStorage
import
ZODB.MappingStorage
import
ZODB.tests.util
import
ZODB.tests.util
class
P
(
Persistent
):
class
P
(
Persistent
):
pass
pass
class
AcqImplicitP
(
P
,
Acquisition
.
Implicit
):
pass
class
AcqImplicitOOBTree
(
OOBTree
,
Acquisition
.
Implicit
):
pass
class
ZODBTests
(
ZODB
.
tests
.
util
.
TestCase
):
class
ZODBTests
(
ZODB
.
tests
.
util
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -328,6 +340,28 @@ class ZODBTests(ZODB.tests.util.TestCase):
...
@@ -328,6 +340,28 @@ class ZODBTests(ZODB.tests.util.TestCase):
cn
.
close
()
cn
.
close
()
def
checkSavepointRollbackAndReadCurrent
(
self
):
'''
savepoint rollback after readcurrent was called on a new object
should not raise POSKeyError
'''
cn
=
self
.
_db
.
open
()
try
:
transaction
.
begin
()
root
=
cn
.
root
()
added_before_savepoint
=
AcqImplicitP
()
root
[
'added_before_savepoint'
]
=
added_before_savepoint
sp
=
transaction
.
savepoint
()
added_before_savepoint
.
btree
=
new_btree
=
AcqImplicitOOBTree
()
cn
.
add
(
new_btree
)
new_btree
[
'change_to_trigger_read_current'
]
=
AcqImplicitP
()
sp
.
rollback
()
transaction
.
commit
()
self
.
assertTrue
(
'added_before_savepoint'
in
root
)
finally
:
transaction
.
abort
()
cn
.
close
()
def
checkFailingSavepointSticks
(
self
):
def
checkFailingSavepointSticks
(
self
):
cn
=
self
.
_db
.
open
()
cn
=
self
.
_db
.
open
()
rt
=
cn
.
root
()
rt
=
cn
.
root
()
...
...
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