Commit 416dc861 authored by Tres Seaver's avatar Tres Seaver

Test pure-Python LL entities everywhere.

parent c9c18181
......@@ -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
......
......@@ -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 LLSetTest(ExtendedSetTests, unittest.TestCase):
class LLTreeSetTestPy(NormalSetTests, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LLBTree import LLSet
return LLSet
from BTrees.LLBTree import LLTreeSetPy
return LLTreeSetPy
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(LLModuleTest),
unittest.makeSuite(LLSetTest),
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),
))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment