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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
1f2d5546
Commit
1f2d5546
authored
Apr 12, 2001
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
There were some tests that tested for failure, but that didn't
recognize other valid failure modes.
parent
f1ee7322
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
+30
-8
src/ZODB/tests/BasicStorage.py
src/ZODB/tests/BasicStorage.py
+30
-8
No files found.
src/ZODB/tests/BasicStorage.py
View file @
1f2d5546
...
...
@@ -26,14 +26,36 @@ class BasicStorage:
POSException
.
StorageTransactionError
,
self
.
_storage
.
store
,
0
,
0
,
0
,
0
,
Transaction
())
self
.
assertRaises
(
POSException
.
StorageTransactionError
,
self
.
_storage
.
abortVersion
,
0
,
Transaction
())
self
.
assertRaises
(
POSException
.
StorageTransactionError
,
self
.
_storage
.
commitVersion
,
0
,
1
,
Transaction
())
#JF# The following will fail two ways. UnitTest doesn't
#JF# help us here:
#JF# self.assertRaises(
#JF# POSException.StorageTransactionError,
#JF# self._storage.abortVersion,
#JF# 0, Transaction())
#JF# but we can do it another way:
try
:
self
.
_storage
.
abortVersion
(
'dummy'
,
Transaction
())
except
(
POSException
.
StorageTransactionError
,
POSException
.
VersionCommitError
):
pass
# test passed ;)
else
:
assert
0
,
"Should have failed, invalid transaction."
#JF# ditto
#JF# self.assertRaises(
#JF# POSException.StorageTransactionError,
#JF# self._storage.commitVersion,
#JF# 0, 1, Transaction())
try
:
self
.
_storage
.
commitVersion
(
'dummy'
,
'dummer'
,
Transaction
())
except
(
POSException
.
StorageTransactionError
,
POSException
.
VersionCommitError
):
pass
# test passed ;)
else
:
assert
0
,
"Should have failed, invalid transaction."
self
.
assertRaises
(
POSException
.
StorageTransactionError
,
self
.
_storage
.
store
,
...
...
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