Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Zope
Commits
18f51531
Commit
18f51531
authored
Apr 16, 2001
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fleshed out as the base class for testing storages at the ZODB level.
parent
ab2bd85c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
lib/python/BDBStorage/tests/ZODBTestBase.py
lib/python/BDBStorage/tests/ZODBTestBase.py
+37
-1
No files found.
lib/python/BDBStorage/tests/ZODBTestBase.py
View file @
18f51531
#
U
nit tests at the ZODB layer
#
Base class for u
nit tests at the ZODB layer
import
os
import
errno
import
unittest
from
ZODB
import
DB
DBHOME
=
'test-db'
class
ZODBTestBase
(
unittest
.
TestCase
):
def
setUp
(
self
):
os
.
mkdir
(
DBHOME
)
try
:
self
.
_storage
=
self
.
ConcreteStorage
(
DBHOME
)
self
.
_db
=
DB
(
self
.
_storage
)
self
.
_conn
=
self
.
_db
.
open
()
self
.
_root
=
self
.
_conn
.
root
()
except
:
self
.
tearDown
()
raise
def
_close
(
self
):
self
.
_db
.
close
()
def
tearDown
(
self
):
# If the tests exited with any uncommitted objects, they'll blow up
# subsequent tests because the next transaction commit will try to
# commit those object. But they're tied to closed databases, so
# that's broken. Aborting the transaction now saves us the headache.
get_transaction
().
abort
()
self
.
_close
()
for
file
in
os
.
listdir
(
DBHOME
):
os
.
unlink
(
os
.
path
.
join
(
DBHOME
,
file
))
os
.
removedirs
(
DBHOME
)
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