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
0ddef194
Commit
0ddef194
authored
Feb 16, 2001
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for TreeSets.
parent
43a7b3cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
10 deletions
+39
-10
src/BTrees/tests/testBTrees.py
src/BTrees/tests/testBTrees.py
+39
-10
No files found.
src/BTrees/tests/testBTrees.py
View file @
0ddef194
...
...
@@ -91,10 +91,10 @@ except:
sys
.
path
.
insert
(
0
,
'../..'
)
import
ZODB
from
BTrees.OOBTree
import
OOBTree
,
OOBucket
,
OOSet
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IISet
from
BTrees.OIBTree
import
OIBTree
,
OIBucket
,
OISet
from
BTrees.OOBTree
import
OOBTree
,
OOBucket
,
OOSet
,
OOTreeSet
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
,
IOTreeSet
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IISet
,
IITreeSet
from
BTrees.OIBTree
import
OIBTree
,
OIBucket
,
OISet
,
OITreeSet
from
unittest
import
TestCase
,
TestSuite
,
TextTestRunner
,
makeSuite
class
Base
:
...
...
@@ -263,7 +263,7 @@ class MappingBase(Base):
diff
=
lsubtract
(
list
(
self
.
t
.
keys
()),
[])
assert
diff
==
[],
diff
class
SetTests
(
Base
):
class
Normal
SetTests
(
Base
):
""" Test common to all set types """
def
testInsertReturnsValue
(
self
):
t
=
self
.
t
...
...
@@ -342,13 +342,20 @@ class SetTests(Base):
assert
t
.
minKey
(
3
)
==
3
assert
t
.
minKey
(
9
)
==
10
class
ExtendedSetTests
(
NormalSetTests
):
def
testLen
(
self
):
# should sets know their length?
t
=
self
.
t
r
=
xrange
(
10000
)
for
x
in
r
:
t
.
insert
(
x
)
assert
len
(
t
)
==
10000
,
len
(
t
)
def
testGetItem
(
self
):
t
=
self
.
t
r
=
xrange
(
10000
)
for
x
in
r
:
t
.
insert
(
x
)
for
x
in
r
:
assert
t
[
x
]
==
x
class
BucketTests
(
MappingBase
):
""" Tests common to all buckets """
pass
...
...
@@ -609,22 +616,38 @@ class TestIIBTrees(BTreeTests, TestCase):
## Set tests
class
TestIOSets
(
SetTests
,
TestCase
):
class
TestIOSets
(
Extended
SetTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
IOSet
()
class
TestOOSets
(
SetTests
,
TestCase
):
class
TestOOSets
(
Extended
SetTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
OOSet
()
class
TestIISets
(
SetTests
,
TestCase
):
class
TestIISets
(
Extended
SetTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
IISet
()
class
TestOISets
(
SetTests
,
TestCase
):
class
TestOISets
(
Extended
SetTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
OISet
()
class
TestIOTreeSets
(
NormalSetTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
IOTreeSet
()
class
TestOOTreeSets
(
NormalSetTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
OOTreeSet
()
class
TestIITreeSets
(
NormalSetTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
IITreeSet
()
class
TestOITreeSets
(
NormalSetTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
OITreeSet
()
## Bucket tests
class
TestIOBuckets
(
BucketTests
,
TestCase
):
...
...
@@ -654,12 +677,18 @@ def main():
TOISet
=
makeSuite
(
TestIOSets
,
'test'
)
TIISet
=
makeSuite
(
TestOOSets
,
'test'
)
TIOTreeSet
=
makeSuite
(
TestIOTreeSets
,
'test'
)
TOOTreeSet
=
makeSuite
(
TestOOTreeSets
,
'test'
)
TOITreeSet
=
makeSuite
(
TestIOTreeSets
,
'test'
)
TIITreeSet
=
makeSuite
(
TestOOTreeSets
,
'test'
)
TIOBucket
=
makeSuite
(
TestIOBuckets
,
'test'
)
TOOBucket
=
makeSuite
(
TestOOBuckets
,
'test'
)
TOIBucket
=
makeSuite
(
TestOIBuckets
,
'test'
)
TIIBucket
=
makeSuite
(
TestIIBuckets
,
'test'
)
alltests
=
TestSuite
((
TIOSet
,
TOOSet
,
TOISet
,
TIISet
,
TIOTreeSet
,
TOOTreeSet
,
TOITreeSet
,
TIITreeSet
,
TIOBucket
,
TOOBucket
,
TOIBucket
,
TIIBucket
,
TOOBTree
,
TIOBTree
,
TOIBTree
,
TIIBTree
))
runner
=
TextTestRunner
()
...
...
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