Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BTrees
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
BTrees
Commits
fa6a210e
Commit
fa6a210e
authored
Nov 12, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test pure-Python OL entities everywhere.
parent
f795a954
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
158 additions
and
8 deletions
+158
-8
BTrees/check.py
BTrees/check.py
+9
-8
BTrees/tests/test_OLBTree.py
BTrees/tests/test_OLBTree.py
+149
-0
No files found.
BTrees/check.py
View file @
fa6a210e
...
...
@@ -32,17 +32,18 @@ addresses and/or object identity (the synthesized bucket has an address
that doesn't exist in the actual BTree).
"""
from
BTrees.OOBTree
import
OOBTree
,
OOBucket
,
OOSet
,
OOTreeSet
from
BTrees.OOBTree
import
OOBTreePy
,
OOBucketPy
,
OOSetPy
,
OOTreeSetPy
from
BTrees.IFBTree
import
IFBTree
,
IFBucket
,
IFSet
,
IFTreeSet
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IISet
,
IITreeSet
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
,
IOTreeSet
from
BTrees.LFBTree
import
LFBTree
,
LFBucket
,
LFSet
,
LFTreeSet
from
BTrees.LLBTree
import
LLBTree
,
LLBucket
,
LLSet
,
LLTreeSet
from
BTrees.LOBTree
import
LOBTree
,
LOBucket
,
LOSet
,
LOTreeSet
from
BTrees.OIBTree
import
OIBTree
,
OIBucket
,
OISet
,
OITreeSet
from
BTrees.OIBTree
import
OIBTreePy
,
OIBucketPy
,
OISetPy
,
OITreeSetPy
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
,
IOTreeSet
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IISet
,
IITreeSet
from
BTrees.IFBTree
import
IFBTree
,
IFBucket
,
IFSet
,
IFTreeSet
from
BTrees.OLBTree
import
OLBTree
,
OLBucket
,
OLSet
,
OLTreeSet
from
BTrees.
LOBTree
import
LOBTree
,
LOBucket
,
LOSet
,
LOTreeSet
from
BTrees.
LLBTree
import
LLBTree
,
LLBucket
,
LLSet
,
LL
TreeSet
from
BTrees.
LFBTree
import
LFBTree
,
LFBucket
,
LFSet
,
LFTreeSet
from
BTrees.
OLBTree
import
OLBTreePy
,
OLBucketPy
,
OLSetPy
,
OLTreeSetPy
from
BTrees.
OOBTree
import
OOBTree
,
OOBucket
,
OOSet
,
OO
TreeSet
from
BTrees.
OOBTree
import
OOBTreePy
,
OOBucketPy
,
OOSetPy
,
OOTreeSetPy
from
BTrees.utils
import
positive_id
from
BTrees.utils
import
oid_repr
...
...
BTrees/tests/test_OLBTree.py
View file @
fa6a210e
...
...
@@ -36,6 +36,13 @@ class OLBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return
OLBTree
class
OLBTreePyInternalKeyTest
(
InternalKeysMappingTest
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OLBTree
import
OLBTreePy
return
OLBTreePy
class
OLTreeSetInternalKeyTest
(
InternalKeysSetTest
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -43,6 +50,13 @@ class OLTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
return
OLTreeSet
class
OLTreeSetPyInternalKeyTest
(
InternalKeysSetTest
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OLBTree
import
OLTreeSetPy
return
OLTreeSetPy
class
OLBucketTest
(
MappingBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -50,6 +64,13 @@ class OLBucketTest(MappingBase, unittest.TestCase):
return
OLBucket
class
OLBucketPyTest
(
MappingBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OLBTree
import
OLBucketPy
return
OLBucketPy
class
OLTreeSetTest
(
NormalSetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -57,6 +78,13 @@ class OLTreeSetTest(NormalSetTests, unittest.TestCase):
return
OLTreeSet
class
OLTreeSetPyTest
(
NormalSetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OLBTree
import
OLTreeSetPy
return
OLTreeSetPy
class
OLSetTest
(
ExtendedSetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -64,6 +92,13 @@ class OLSetTest(ExtendedSetTests, unittest.TestCase):
return
OLSet
class
OLSetPyTest
(
ExtendedSetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OLBTree
import
OLSetPy
return
OLSetPy
class
OLBTreeTest
(
BTreeTests
,
TestLongIntValues
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
...
...
@@ -74,16 +109,30 @@ class OLBTreeTest(BTreeTests, TestLongIntValues, unittest.TestCase):
return
object
(),
object
()
class
OLBTreePyTest
(
BTreeTests
,
TestLongIntValues
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
from
BTrees.OLBTree
import
OLBTreePy
return
OLBTreePy
()
def
getTwoKeys
(
self
):
return
object
(),
object
()
class
PureOL
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
from
BTrees.OLBTree
import
union
return
union
(
*
args
)
def
intersection
(
self
,
*
args
):
from
BTrees.OLBTree
import
intersection
return
intersection
(
*
args
)
def
difference
(
self
,
*
args
):
from
BTrees.OLBTree
import
difference
return
difference
(
*
args
)
def
builders
(
self
):
from
BTrees.OLBTree
import
OLBTree
from
BTrees.OLBTree
import
OLBucket
...
...
@@ -92,22 +141,51 @@ class PureOL(SetResult, unittest.TestCase):
return
OLSet
,
OLTreeSet
,
makeBuilder
(
OLBTree
),
makeBuilder
(
OLBucket
)
class
PureOLPy
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
from
BTrees.OLBTree
import
unionPy
return
unionPy
(
*
args
)
def
intersection
(
self
,
*
args
):
from
BTrees.OLBTree
import
intersectionPy
return
intersectionPy
(
*
args
)
def
difference
(
self
,
*
args
):
from
BTrees.OLBTree
import
differencePy
return
differencePy
(
*
args
)
def
builders
(
self
):
from
BTrees.OLBTree
import
OLBTreePy
from
BTrees.OLBTree
import
OLBucketPy
from
BTrees.OLBTree
import
OLTreeSetPy
from
BTrees.OLBTree
import
OLSetPy
return
(
OLSetPy
,
OLTreeSetPy
,
makeBuilder
(
OLBTreePy
),
makeBuilder
(
OLBucketPy
))
class
TestWeightedOL
(
Weighted
,
unittest
.
TestCase
):
def
weightedUnion
(
self
):
from
BTrees.OLBTree
import
weightedUnion
return
weightedUnion
def
weightedIntersection
(
self
):
from
BTrees.OLBTree
import
weightedIntersection
return
weightedIntersection
def
union
(
self
):
from
BTrees.OLBTree
import
union
return
union
def
intersection
(
self
):
from
BTrees.OLBTree
import
intersection
return
intersection
def
mkbucket
(
self
,
*
args
):
from
BTrees.OLBTree
import
OLBucket
as
mkbucket
return
mkbucket
(
*
args
)
def
builders
(
self
):
from
BTrees.OLBTree
import
OLBTree
from
BTrees.OLBTree
import
OLBucket
...
...
@@ -116,6 +194,37 @@ class TestWeightedOL(Weighted, unittest.TestCase):
return
OLBucket
,
OLBTree
,
itemsToSet
(
OLSet
),
itemsToSet
(
OLTreeSet
)
class
TestWeightedOLPy
(
Weighted
,
unittest
.
TestCase
):
def
weightedUnion
(
self
):
from
BTrees.OLBTree
import
weightedUnionPy
return
weightedUnionPy
def
weightedIntersection
(
self
):
from
BTrees.OLBTree
import
weightedIntersectionPy
return
weightedIntersectionPy
def
union
(
self
):
from
BTrees.OLBTree
import
unionPy
return
unionPy
def
intersection
(
self
):
from
BTrees.OLBTree
import
intersectionPy
return
intersectionPy
def
mkbucket
(
self
,
*
args
):
from
BTrees.OLBTree
import
OLBucketPy
as
mkbucket
return
mkbucket
(
*
args
)
def
builders
(
self
):
from
BTrees.OLBTree
import
OLBTreePy
from
BTrees.OLBTree
import
OLBucketPy
from
BTrees.OLBTree
import
OLTreeSetPy
from
BTrees.OLBTree
import
OLSetPy
return
(
OLBucketPy
,
OLBTreePy
,
itemsToSet
(
OLSetPy
),
itemsToSet
(
OLTreeSetPy
))
class
OLBucketConflictTests
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -123,6 +232,13 @@ class OLBucketConflictTests(MappingConflictTestBase, unittest.TestCase):
return
OLBucket
class
OLBucketPyConflictTests
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OLBTree
import
OLBucketPy
return
OLBucketPy
class
OLSetConflictTests
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -130,6 +246,13 @@ class OLSetConflictTests(SetConflictTestBase, unittest.TestCase):
return
OLSet
class
OLSetPyConflictTests
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OLBTree
import
OLSetPy
return
OLSetPy
class
OLBTreeConflictTests
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -137,6 +260,13 @@ class OLBTreeConflictTests(MappingConflictTestBase, unittest.TestCase):
return
OLBTree
class
OLBTreePyConflictTests
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OLBTree
import
OLBTreePy
return
OLBTreePy
class
OLTreeSetConflictTests
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -144,6 +274,13 @@ class OLTreeSetConflictTests(SetConflictTestBase, unittest.TestCase):
return
OLTreeSet
class
OLTreeSetPyConflictTests
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OLBTree
import
OLTreeSetPy
return
OLTreeSetPy
class
OLModuleTest
(
ModuleTest
,
unittest
.
TestCase
):
prefix
=
'OL'
...
...
@@ -168,16 +305,28 @@ class OLModuleTest(ModuleTest, unittest.TestCase):
def
test_suite
():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
OLBTreeInternalKeyTest
),
unittest
.
makeSuite
(
OLBTreePyInternalKeyTest
),
unittest
.
makeSuite
(
OLTreeSetInternalKeyTest
),
unittest
.
makeSuite
(
OLTreeSetPyInternalKeyTest
),
unittest
.
makeSuite
(
OLBucketTest
),
unittest
.
makeSuite
(
OLBucketPyTest
),
unittest
.
makeSuite
(
OLTreeSetTest
),
unittest
.
makeSuite
(
OLTreeSetPyTest
),
unittest
.
makeSuite
(
OLSetTest
),
unittest
.
makeSuite
(
OLSetPyTest
),
unittest
.
makeSuite
(
OLBTreeTest
),
unittest
.
makeSuite
(
OLBTreePyTest
),
unittest
.
makeSuite
(
PureOL
),
unittest
.
makeSuite
(
PureOLPy
),
unittest
.
makeSuite
(
TestWeightedOL
),
unittest
.
makeSuite
(
TestWeightedOLPy
),
unittest
.
makeSuite
(
OLBucketConflictTests
),
unittest
.
makeSuite
(
OLBucketPyConflictTests
),
unittest
.
makeSuite
(
OLSetConflictTests
),
unittest
.
makeSuite
(
OLSetPyConflictTests
),
unittest
.
makeSuite
(
OLBTreeConflictTests
),
unittest
.
makeSuite
(
OLBTreePyConflictTests
),
unittest
.
makeSuite
(
OLTreeSetConflictTests
),
unittest
.
makeSuite
(
OLTreeSetPyConflictTests
),
unittest
.
makeSuite
(
OLModuleTest
),
))
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