Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
ZODB
Commits
1f2d5546
Commit
1f2d5546
authored
23 years ago
by
Jim Fulton
Browse files
Options
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
,
...
...
This diff is collapsed.
Click to expand it.
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