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
416dc861
Commit
416dc861
authored
Nov 13, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test pure-Python LL entities everywhere.
parent
c9c18181
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
197 additions
and
4 deletions
+197
-4
BTrees/check.py
BTrees/check.py
+1
-0
BTrees/tests/test_LLBTree.py
BTrees/tests/test_LLBTree.py
+196
-4
No files found.
BTrees/check.py
View file @
416dc861
...
...
@@ -41,6 +41,7 @@ from BTrees.IOBTree import IOBTreePy, IOBucketPy, IOSetPy, IOTreeSetPy
from
BTrees.LFBTree
import
LFBTree
,
LFBucket
,
LFSet
,
LFTreeSet
from
BTrees.LFBTree
import
LFBTreePy
,
LFBucketPy
,
LFSetPy
,
LFTreeSetPy
from
BTrees.LLBTree
import
LLBTree
,
LLBucket
,
LLSet
,
LLTreeSet
from
BTrees.LLBTree
import
LLBTreePy
,
LLBucketPy
,
LLSetPy
,
LLTreeSetPy
from
BTrees.LOBTree
import
LOBTree
,
LOBucket
,
LOSet
,
LOTreeSet
from
BTrees.OIBTree
import
OIBTree
,
OIBucket
,
OISet
,
OITreeSet
from
BTrees.OIBTree
import
OIBTreePy
,
OIBucketPy
,
OISetPy
,
OITreeSetPy
...
...
BTrees/tests/test_LLBTree.py
View file @
416dc861
...
...
@@ -39,6 +39,13 @@ class LLBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return
LLBTree
class
LLBTreePyInternalKeyTest
(
InternalKeysMappingTest
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.LLBTree
import
LLBTreePy
return
LLBTreePy
class
LLTreeSetInternalKeyTest
(
InternalKeysSetTest
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -46,6 +53,13 @@ class LLTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
return
LLTreeSet
class
LLTreeSetPyInternalKeyTest
(
InternalKeysSetTest
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.LLBTree
import
LLTreeSetPy
return
LLTreeSetPy
class
LLBucketTest
(
MappingBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -53,6 +67,13 @@ class LLBucketTest(MappingBase, unittest.TestCase):
return
LLBucket
class
LLBucketTestPy
(
MappingBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.LLBTree
import
LLBucketPy
return
LLBucketPy
class
LLTreeSetTest
(
NormalSetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -60,11 +81,11 @@ class LLTreeSetTest(NormalSetTests, unittest.TestCase):
return
LLTreeSet
class
LL
SetTest
(
Extended
SetTests
,
unittest
.
TestCase
):
class
LL
TreeSetTestPy
(
Normal
SetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.LLBTree
import
LL
Set
return
LL
Set
from
BTrees.LLBTree
import
LL
TreeSetPy
return
LL
TreeSetPy
class
LLSetTest
(
ExtendedSetTests
,
unittest
.
TestCase
):
...
...
@@ -74,6 +95,13 @@ class LLSetTest(ExtendedSetTests, unittest.TestCase):
return
LLSet
class
LLSetTestPy
(
ExtendedSetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.LLBTree
import
LLSetPy
return
LLSetPy
class
LLBTreeTest
(
BTreeTests
,
TestLongIntKeys
,
TestLongIntValues
,
unittest
.
TestCase
):
...
...
@@ -84,6 +112,16 @@ class LLBTreeTest(BTreeTests, TestLongIntKeys, TestLongIntValues,
return
1
,
2
class
LLBTreeTestPy
(
BTreeTests
,
TestLongIntKeys
,
TestLongIntValues
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
from
BTrees.LLBTree
import
LLBTreePy
return
LLBTreePy
()
def
getTwoValues
(
self
):
return
1
,
2
class
TestLLSets
(
I_SetsBase
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
...
...
@@ -91,6 +129,13 @@ class TestLLSets(I_SetsBase, unittest.TestCase):
return
LLSet
()
class
TestLLSetsPy
(
I_SetsBase
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
from
BTrees.LLBTree
import
LLSetPy
return
LLSetPy
()
class
TestLLTreeSets
(
I_SetsBase
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
...
...
@@ -98,16 +143,27 @@ class TestLLTreeSets(I_SetsBase, unittest.TestCase):
return
LLTreeSet
()
class
TestLLTreeSetsPy
(
I_SetsBase
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
from
BTrees.LLBTree
import
LLTreeSetPy
return
LLTreeSetPy
()
class
PureLL
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
from
BTrees.LLBTree
import
union
return
union
(
*
args
)
def
intersection
(
self
,
*
args
):
from
BTrees.LLBTree
import
intersection
return
intersection
(
*
args
)
def
difference
(
self
,
*
args
):
from
BTrees.LLBTree
import
difference
return
difference
(
*
args
)
def
builders
(
self
):
from
BTrees.LLBTree
import
LLBTree
from
BTrees.LLBTree
import
LLBucket
...
...
@@ -116,43 +172,105 @@ class PureLL(SetResult, unittest.TestCase):
return
LLSet
,
LLTreeSet
,
makeBuilder
(
LLBTree
),
makeBuilder
(
LLBucket
)
class
PureLLPy
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
from
BTrees.LLBTree
import
unionPy
return
unionPy
(
*
args
)
def
intersection
(
self
,
*
args
):
from
BTrees.LLBTree
import
intersectionPy
return
intersectionPy
(
*
args
)
def
difference
(
self
,
*
args
):
from
BTrees.LLBTree
import
differencePy
return
differencePy
(
*
args
)
def
builders
(
self
):
from
BTrees.LLBTree
import
LLBTreePy
from
BTrees.LLBTree
import
LLBucketPy
from
BTrees.LLBTree
import
LLTreeSetPy
from
BTrees.LLBTree
import
LLSetPy
return
(
LLSetPy
,
LLTreeSetPy
,
makeBuilder
(
LLBTreePy
),
makeBuilder
(
LLBucketPy
))
class
TestLLMultiUnion
(
MultiUnion
,
unittest
.
TestCase
):
def
multiunion
(
self
,
*
args
):
from
BTrees.LLBTree
import
multiunion
return
multiunion
(
*
args
)
def
union
(
self
,
*
args
):
from
BTrees.LLBTree
import
union
return
union
(
*
args
)
def
mkset
(
self
,
*
args
):
from
BTrees.LLBTree
import
LLSet
as
mkset
return
mkset
(
*
args
)
def
mktreeset
(
self
,
*
args
):
from
BTrees.LLBTree
import
LLTreeSet
as
mktreeset
return
mktreeset
(
*
args
)
def
mkbucket
(
self
,
*
args
):
from
BTrees.LLBTree
import
LLBucket
as
mkbucket
return
mkbucket
(
*
args
)
def
mkbtree
(
self
,
*
args
):
from
BTrees.LLBTree
import
LLBTree
as
mkbtree
return
mkbtree
(
*
args
)
class
TestLLMultiUnionPy
(
MultiUnion
,
unittest
.
TestCase
):
def
multiunion
(
self
,
*
args
):
from
BTrees.LLBTree
import
multiunionPy
return
multiunionPy
(
*
args
)
def
union
(
self
,
*
args
):
from
BTrees.LLBTree
import
unionPy
return
unionPy
(
*
args
)
def
mkset
(
self
,
*
args
):
from
BTrees.LLBTree
import
LLSetPy
as
mkset
return
mkset
(
*
args
)
def
mktreeset
(
self
,
*
args
):
from
BTrees.LLBTree
import
LLTreeSetPy
as
mktreeset
return
mktreeset
(
*
args
)
def
mkbucket
(
self
,
*
args
):
from
BTrees.LLBTree
import
LLBucketPy
as
mkbucket
return
mkbucket
(
*
args
)
def
mkbtree
(
self
,
*
args
):
from
BTrees.LLBTree
import
LLBTreePy
as
mkbtree
return
mkbtree
(
*
args
)
class
TestWeightedLL
(
Weighted
,
unittest
.
TestCase
):
def
weightedUnion
(
self
):
from
BTrees.LLBTree
import
weightedUnion
return
weightedUnion
def
weightedIntersection
(
self
):
from
BTrees.LLBTree
import
weightedIntersection
return
weightedIntersection
def
union
(
self
):
from
BTrees.LLBTree
import
union
return
union
def
intersection
(
self
):
from
BTrees.LLBTree
import
intersection
return
intersection
def
mkbucket
(
self
,
*
args
):
from
BTrees.LLBTree
import
LLBucket
as
mkbucket
return
mkbucket
(
*
args
)
def
builders
(
self
):
from
BTrees.LLBTree
import
LLBTree
from
BTrees.LLBTree
import
LLBucket
...
...
@@ -161,6 +279,37 @@ class TestWeightedLL(Weighted, unittest.TestCase):
return
LLBucket
,
LLBTree
,
itemsToSet
(
LLSet
),
itemsToSet
(
LLTreeSet
)
class
TestWeightedLLPy
(
Weighted
,
unittest
.
TestCase
):
def
weightedUnion
(
self
):
from
BTrees.LLBTree
import
weightedUnionPy
return
weightedUnionPy
def
weightedIntersection
(
self
):
from
BTrees.LLBTree
import
weightedIntersectionPy
return
weightedIntersectionPy
def
union
(
self
):
from
BTrees.LLBTree
import
unionPy
return
unionPy
def
intersection
(
self
):
from
BTrees.LLBTree
import
intersectionPy
return
intersectionPy
def
mkbucket
(
self
,
*
args
):
from
BTrees.LLBTree
import
LLBucketPy
as
mkbucket
return
mkbucket
(
*
args
)
def
builders
(
self
):
from
BTrees.LLBTree
import
LLBTreePy
from
BTrees.LLBTree
import
LLBucketPy
from
BTrees.LLBTree
import
LLTreeSetPy
from
BTrees.LLBTree
import
LLSetPy
return
(
LLBucketPy
,
LLBTreePy
,
itemsToSet
(
LLSetPy
),
itemsToSet
(
LLTreeSetPy
))
class
LLBTreeConflictTests
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -168,6 +317,13 @@ class LLBTreeConflictTests(MappingConflictTestBase, unittest.TestCase):
return
LLBTree
class
LLBTreeConflictTestsPy
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.LLBTree
import
LLBTreePy
return
LLBTreePy
class
LLBucketConflictTests
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -175,6 +331,13 @@ class LLBucketConflictTests(MappingConflictTestBase, unittest.TestCase):
return
LLBucket
class
LLBucketConflictTestsPy
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.LLBTree
import
LLBucketPy
return
LLBucketPy
class
LLTreeSetConflictTests
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -182,6 +345,13 @@ class LLTreeSetConflictTests(SetConflictTestBase, unittest.TestCase):
return
LLTreeSet
class
LLTreeSetConflictTestsPy
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.LLBTree
import
LLTreeSetPy
return
LLTreeSetPy
class
LLSetConflictTests
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -189,6 +359,13 @@ class LLSetConflictTests(SetConflictTestBase, unittest.TestCase):
return
LLSet
class
LLSetConflictTestsPy
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.LLBTree
import
LLSetPy
return
LLSetPy
class
LLModuleTest
(
ModuleTest
,
unittest
.
TestCase
):
prefix
=
'LL'
...
...
@@ -205,19 +382,34 @@ class LLModuleTest(ModuleTest, unittest.TestCase):
def
test_suite
():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
LLBTreeInternalKeyTest
),
unittest
.
makeSuite
(
LLBTreeInternalKeyTest
),
unittest
.
makeSuite
(
LLTreeSetInternalKeyTest
),
unittest
.
makeSuite
(
LLTreeSetInternalKeyTest
),
unittest
.
makeSuite
(
LLBucketTest
),
unittest
.
makeSuite
(
LLBucketTest
),
unittest
.
makeSuite
(
LLTreeSetTest
),
unittest
.
makeSuite
(
LLTreeSetTest
),
unittest
.
makeSuite
(
LLSetTest
),
unittest
.
makeSuite
(
LL
Module
Test
),
unittest
.
makeSuite
(
LL
Set
Test
),
unittest
.
makeSuite
(
LLBTreeTest
),
unittest
.
makeSuite
(
LLBTreeTest
),
unittest
.
makeSuite
(
TestLLSets
),
unittest
.
makeSuite
(
TestLLSets
),
unittest
.
makeSuite
(
TestLLTreeSets
),
unittest
.
makeSuite
(
TestLLTreeSets
),
unittest
.
makeSuite
(
TestLLMultiUnion
),
unittest
.
makeSuite
(
TestLLMultiUnion
),
unittest
.
makeSuite
(
PureLL
),
unittest
.
makeSuite
(
PureLL
),
unittest
.
makeSuite
(
TestWeightedLL
),
unittest
.
makeSuite
(
TestWeightedLL
),
unittest
.
makeSuite
(
LLBTreeConflictTests
),
unittest
.
makeSuite
(
LLBTreeConflictTests
),
unittest
.
makeSuite
(
LLBucketConflictTests
),
unittest
.
makeSuite
(
LLBucketConflictTests
),
unittest
.
makeSuite
(
LLTreeSetConflictTests
),
unittest
.
makeSuite
(
LLTreeSetConflictTests
),
unittest
.
makeSuite
(
LLSetConflictTests
),
unittest
.
makeSuite
(
LLSetConflictTests
),
unittest
.
makeSuite
(
LLModuleTest
),
))
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