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
8e8798e7
Commit
8e8798e7
authored
Sep 11, 2003
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to make BDBStorage tests display a message if they're run when BDBStorage is not available.
parent
d8f18ad8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
45 deletions
+54
-45
lib/python/BDBStorage/tests/BerkeleyTestBase.py
lib/python/BDBStorage/tests/BerkeleyTestBase.py
+18
-0
lib/python/BDBStorage/tests/test_autopack.py
lib/python/BDBStorage/tests/test_autopack.py
+9
-10
lib/python/BDBStorage/tests/test_create.py
lib/python/BDBStorage/tests/test_create.py
+8
-7
lib/python/BDBStorage/tests/test_storage_api.py
lib/python/BDBStorage/tests/test_storage_api.py
+5
-7
lib/python/BDBStorage/tests/test_virgin.py
lib/python/BDBStorage/tests/test_virgin.py
+4
-6
lib/python/BDBStorage/tests/test_whitebox.py
lib/python/BDBStorage/tests/test_whitebox.py
+6
-8
lib/python/BDBStorage/tests/test_zodb_simple.py
lib/python/BDBStorage/tests/test_zodb_simple.py
+4
-7
No files found.
lib/python/BDBStorage/tests/BerkeleyTestBase.py
View file @
8e8798e7
...
@@ -18,7 +18,10 @@
...
@@ -18,7 +18,10 @@
import
os
import
os
import
errno
import
errno
import
shutil
import
shutil
import
sys
import
unittest
import
BDBStorage
from
BDBStorage.BerkeleyBase
import
BerkeleyConfig
from
BDBStorage.BerkeleyBase
import
BerkeleyConfig
from
ZODB.tests.StorageTestBase
import
StorageTestBase
from
ZODB.tests.StorageTestBase
import
StorageTestBase
...
@@ -77,3 +80,18 @@ class MinimalTestBase(BerkeleyTestBase):
...
@@ -77,3 +80,18 @@ class MinimalTestBase(BerkeleyTestBase):
class
FullTestBase
(
BerkeleyTestBase
):
class
FullTestBase
(
BerkeleyTestBase
):
from
BDBStorage
import
BDBFullStorage
from
BDBStorage
import
BDBFullStorage
ConcreteStorage
=
BDBFullStorage
.
BDBFullStorage
ConcreteStorage
=
BDBFullStorage
.
BDBFullStorage
def
makeSuite
(
*
args
,
**
kw
):
prefix
=
kw
.
get
(
'prefix'
,
'check'
)
level
=
kw
.
get
(
'level'
)
suite
=
unittest
.
TestSuite
()
if
level
:
suite
.
level
=
level
if
BDBStorage
.
is_available
:
for
klass
in
args
:
suite
.
addTest
(
unittest
.
makeSuite
(
klass
,
prefix
))
else
:
sys
.
stderr
.
write
(
"BDBStorage not available, tests disabled
\
n
"
)
return
suite
lib/python/BDBStorage/tests/test_autopack.py
View file @
8e8798e7
...
@@ -533,16 +533,15 @@ class TestMinimalClassicPackRaceCondition(RaceConditionBase):
...
@@ -533,16 +533,15 @@ class TestMinimalClassicPackRaceCondition(RaceConditionBase):
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
return
BDBStorage
.
tests
.
BerkeleyTestBase
.
makeSuite
(
suite
.
level
=
2
TestAutopack
,
if
BDBStorage
.
is_available
:
TestAutomaticClassicPack
,
suite
.
addTest
(
unittest
.
makeSuite
(
TestAutopack
))
TestMinimalPack
,
suite
.
addTest
(
unittest
.
makeSuite
(
TestAutomaticClassicPack
))
TestFullClassicPackRaceCondition
,
suite
.
addTest
(
unittest
.
makeSuite
(
TestMinimalPack
))
TestMinimalClassicPackRaceCondition
,
suite
.
addTest
(
unittest
.
makeSuite
(
TestFullClassicPackRaceCondition
))
prefix
=
'test'
,
suite
.
addTest
(
unittest
.
makeSuite
(
TestMinimalClassicPackRaceCondition
))
level
=
2
return
suite
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
lib/python/BDBStorage/tests/test_create.py
View file @
8e8798e7
...
@@ -111,13 +111,14 @@ class OpenRecoveryTest(BerkeleyTestBase.FullTestBase):
...
@@ -111,13 +111,14 @@ class OpenRecoveryTest(BerkeleyTestBase.FullTestBase):
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
return
BDBStorage
.
tests
.
BerkeleyTestBase
.
makeSuite
(
if
BDBStorage
.
is_available
:
MinimalCreateTest
,
suite
.
addTest
(
unittest
.
makeSuite
(
MinimalCreateTest
))
FullCreateTest
,
suite
.
addTest
(
unittest
.
makeSuite
(
FullCreateTest
))
FullOpenExistingTest
,
suite
.
addTest
(
unittest
.
makeSuite
(
FullOpenExistingTest
))
FullOpenCloseTest
,
suite
.
addTest
(
unittest
.
makeSuite
(
FullOpenCloseTest
))
OpenRecoveryTest
,
suite
.
addTest
(
unittest
.
makeSuite
(
OpenRecoveryTest
))
prefix
=
'test'
)
return
suite
return
suite
...
...
lib/python/BDBStorage/tests/test_storage_api.py
View file @
8e8798e7
...
@@ -77,13 +77,11 @@ class FullRecoveryTest(BerkeleyTestBase.FullTestBase,
...
@@ -77,13 +77,11 @@ class FullRecoveryTest(BerkeleyTestBase.FullTestBase,
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
return
BDBStorage
.
tests
.
BerkeleyTestBase
.
makeSuite
(
if
BDBStorage
.
is_available
:
FullTest
,
suite
.
addTest
(
unittest
.
makeSuite
(
FullTest
,
'check'
))
FullRecoveryTest
,
suite
.
addTest
(
unittest
.
makeSuite
(
FullRecoveryTest
,
'check'
))
MinimalTest
,
suite
.
addTest
(
unittest
.
makeSuite
(
MinimalTest
,
'check'
))
)
return
suite
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
lib/python/BDBStorage/tests/test_virgin.py
View file @
8e8798e7
...
@@ -46,12 +46,10 @@ class MinimalNewInsertsTest(ZODBTestBase, InsertMixin):
...
@@ -46,12 +46,10 @@ class MinimalNewInsertsTest(ZODBTestBase, InsertMixin):
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
return
BDBStorage
.
tests
.
BerkeleyTestBase
.
makeSuite
(
if
BDBStorage
.
is_available
:
MinimalNewInsertsTest
,
suite
.
addTest
(
unittest
.
makeSuite
(
MinimalNewInsertsTest
,
'check'
))
FullNewInsertsTest
,
suite
.
addTest
(
unittest
.
makeSuite
(
FullNewInsertsTest
,
'check'
))
)
return
suite
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
lib/python/BDBStorage/tests/test_whitebox.py
View file @
8e8798e7
...
@@ -246,14 +246,12 @@ class WhiteboxHighLevelFull(ZODBTestBase):
...
@@ -246,14 +246,12 @@ class WhiteboxHighLevelFull(ZODBTestBase):
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
return
BDBStorage
.
tests
.
BerkeleyTestBase
.
makeSuite
(
if
BDBStorage
.
is_available
:
WhiteboxLowLevelMinimal
,
suite
.
addTest
(
unittest
.
makeSuite
(
WhiteboxLowLevelMinimal
,
'check'
))
WhiteboxHighLevelMinimal
,
suite
.
addTest
(
unittest
.
makeSuite
(
WhiteboxHighLevelMinimal
,
'check'
))
WhiteboxLowLevelFull
,
suite
.
addTest
(
unittest
.
makeSuite
(
WhiteboxLowLevelFull
,
'check'
))
WhiteboxHighLevelFull
,
suite
.
addTest
(
unittest
.
makeSuite
(
WhiteboxHighLevelFull
,
'check'
))
)
return
suite
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
lib/python/BDBStorage/tests/test_zodb_simple.py
View file @
8e8798e7
...
@@ -78,13 +78,10 @@ class FullCommitAndRead(ZODBTestBase, CommitAndRead):
...
@@ -78,13 +78,10 @@ class FullCommitAndRead(ZODBTestBase, CommitAndRead):
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
return
BDBStorage
.
tests
.
BerkeleyTestBase
.
makeSuite
(
if
BDBStorage
.
is_available
:
MinimalCommitAndRead
,
suite
.
addTest
(
unittest
.
makeSuite
(
MinimalCommitAndRead
,
'check'
))
FullCommitAndRead
suite
.
addTest
(
unittest
.
makeSuite
(
FullCommitAndRead
,
'check'
))
)
return
suite
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
unittest
.
main
(
defaultTest
=
'test_suite'
)
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