Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
4cce220f
Commit
4cce220f
authored
Jun 10, 2007
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the undo tests to use the normal undo framework to avoid
spurious failures.
parent
1d38b2a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
55 deletions
+8
-55
src/ZODB/tests/testblob.py
src/ZODB/tests/testblob.py
+8
-55
No files found.
src/ZODB/tests/testblob.py
View file @
4cce220f
...
@@ -104,16 +104,9 @@ class BlobUndoTests(unittest.TestCase):
...
@@ -104,16 +104,9 @@ class BlobUndoTests(unittest.TestCase):
root
[
'blob'
]
=
Blob
()
root
[
'blob'
]
=
Blob
()
transaction
.
commit
()
transaction
.
commit
()
serial
=
base64
.
encodestring
(
blob_storage
.
_tid
)
database
.
undo
(
database
.
undoLog
(
0
,
1
)[
0
][
'id'
])
# undo the creation of the previously added blob
transaction
.
begin
()
database
.
undo
(
serial
,
blob_storage
.
_transaction
)
transaction
.
commit
()
transaction
.
commit
()
connection
.
close
()
connection
=
database
.
open
()
root
=
connection
.
root
()
# the blob footprint object should exist no longer
# the blob footprint object should exist no longer
self
.
assertRaises
(
KeyError
,
root
.
__getitem__
,
'blob'
)
self
.
assertRaises
(
KeyError
,
root
.
__getitem__
,
'blob'
)
database
.
close
()
database
.
close
()
...
@@ -135,21 +128,11 @@ class BlobUndoTests(unittest.TestCase):
...
@@ -135,21 +128,11 @@ class BlobUndoTests(unittest.TestCase):
blob
.
open
(
'w'
).
write
(
'this is state 2'
)
blob
.
open
(
'w'
).
write
(
'this is state 2'
)
transaction
.
commit
()
transaction
.
commit
()
transaction
.
begin
()
blob
=
root
[
'blob'
]
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 2'
)
transaction
.
abort
()
serial
=
base64
.
encodestring
(
blob_storage
.
_tid
)
transaction
.
begin
()
database
.
undo
(
database
.
undoLog
(
0
,
1
)[
0
][
'id'
])
blob_storage
.
undo
(
serial
,
blob_storage
.
_transaction
)
transaction
.
commit
()
transaction
.
commit
()
transaction
.
begin
()
blob
=
root
[
'blob'
]
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 1'
)
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 1'
)
transaction
.
abort
()
database
.
close
()
database
.
close
()
def
testUndoAfterConsumption
(
self
):
def
testUndoAfterConsumption
(
self
):
...
@@ -171,21 +154,10 @@ class BlobUndoTests(unittest.TestCase):
...
@@ -171,21 +154,10 @@ class BlobUndoTests(unittest.TestCase):
blob
.
consumeFile
(
'consume2'
)
blob
.
consumeFile
(
'consume2'
)
transaction
.
commit
()
transaction
.
commit
()
transaction
.
begin
()
database
.
undo
(
database
.
undoLog
(
0
,
1
)[
0
][
'id'
])
blob
=
root
[
'blob'
]
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 2'
)
transaction
.
abort
()
serial
=
base64
.
encodestring
(
blob_storage
.
_tid
)
transaction
.
begin
()
blob_storage
.
undo
(
serial
,
blob_storage
.
_transaction
)
transaction
.
commit
()
transaction
.
commit
()
transaction
.
begin
()
blob
=
root
[
'blob'
]
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 1'
)
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 1'
)
transaction
.
abort
()
database
.
close
()
database
.
close
()
...
@@ -207,27 +179,17 @@ class BlobUndoTests(unittest.TestCase):
...
@@ -207,27 +179,17 @@ class BlobUndoTests(unittest.TestCase):
blob
.
open
(
'w'
).
write
(
'this is state 2'
)
blob
.
open
(
'w'
).
write
(
'this is state 2'
)
transaction
.
commit
()
transaction
.
commit
()
serial
=
base64
.
encodestring
(
blob_storage
.
_tid
)
database
.
undo
(
database
.
undoLog
(
0
,
1
)[
0
][
'id'
])
transaction
.
begin
()
database
.
undo
(
serial
)
transaction
.
commit
()
transaction
.
commit
()
transaction
.
begin
()
blob
=
root
[
'blob'
]
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 1'
)
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 1'
)
transaction
.
abort
()
serial
=
base64
.
encodestring
(
blob_storage
.
_tid
)
serial
=
base64
.
encodestring
(
blob_storage
.
_tid
)
transaction
.
begin
()
database
.
undo
(
database
.
undoLog
(
0
,
1
)[
0
][
'id'
])
database
.
undo
(
serial
)
transaction
.
commit
()
transaction
.
commit
()
transaction
.
begin
()
blob
=
root
[
'blob'
]
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 2'
)
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 2'
)
transaction
.
abort
()
database
.
close
()
database
.
close
()
...
@@ -244,24 +206,15 @@ class BlobUndoTests(unittest.TestCase):
...
@@ -244,24 +206,15 @@ class BlobUndoTests(unittest.TestCase):
root
[
'blob'
]
=
blob
root
[
'blob'
]
=
blob
transaction
.
commit
()
transaction
.
commit
()
serial
=
base64
.
encodestring
(
blob_storage
.
_tid
)
database
.
undo
(
database
.
undoLog
(
0
,
1
)[
0
][
'id'
])
transaction
.
begin
()
database
.
undo
(
serial
)
transaction
.
commit
()
transaction
.
commit
()
self
.
assertRaises
(
KeyError
,
root
.
__getitem__
,
'blob'
)
self
.
assertRaises
(
KeyError
,
root
.
__getitem__
,
'blob'
)
serial
=
base64
.
encodestring
(
blob_storage
.
_tid
)
database
.
undo
(
database
.
undoLog
(
0
,
1
)[
0
][
'id'
])
transaction
.
begin
()
database
.
undo
(
serial
)
transaction
.
commit
()
transaction
.
commit
()
transaction
.
begin
()
blob
=
root
[
'blob'
]
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 1'
)
self
.
assertEqual
(
blob
.
open
(
'r'
).
read
(),
'this is state 1'
)
transaction
.
abort
()
database
.
close
()
database
.
close
()
...
...
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