Commit c9c18181 authored by Tres Seaver's avatar Tres Seaver

Test pure-Python LF entities everywhere.

parent 753416e8
......@@ -39,6 +39,7 @@ from BTrees.IIBTree import IIBTreePy, IIBucketPy, IISetPy, IITreeSetPy
from BTrees.IOBTree import IOBTree, IOBucket, IOSet, IOTreeSet
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.LOBTree import LOBTree, LOBucket, LOSet, LOTreeSet
from BTrees.OIBTree import OIBTree, OIBucket, OISet, OITreeSet
......
......@@ -35,6 +35,13 @@ class LFBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return LFBTree
class LFBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LFBTree import LFBTreePy
return LFBTreePy
class LFTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
......@@ -42,6 +49,13 @@ class LFTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
return LFTreeSet
class LFTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LFBTree import LFTreeSetPy
return LFTreeSetPy
class LFBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -49,6 +63,13 @@ class LFBucketTest(MappingBase, unittest.TestCase):
return LFBucket
class LFBucketPyTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LFBTree import LFBucketPy
return LFBucketPy
class LFTreeSetTest(NormalSetTests, unittest.TestCase):
def _getTargetClass(self):
......@@ -56,6 +77,13 @@ class LFTreeSetTest(NormalSetTests, unittest.TestCase):
return LFTreeSet
class LFTreeSetPyTest(NormalSetTests, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LFBTree import LFTreeSetPy
return LFTreeSetPy
class LFSetTest(ExtendedSetTests, unittest.TestCase):
def _getTargetClass(self):
......@@ -63,6 +91,13 @@ class LFSetTest(ExtendedSetTests, unittest.TestCase):
return LFSet
class LFSetPyTest(ExtendedSetTests, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LFBTree import LFSetPy
return LFSetPy
class LFBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
......@@ -73,37 +108,84 @@ class LFBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
return 0.5, 1.5
class LFBTreePyTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.LFBTree import LFBTreePy
return LFBTreePy()
def getTwoValues(self):
return 0.5, 1.5
class TestLFMultiUnion(MultiUnion, unittest.TestCase):
def multiunion(self, *args):
from BTrees.LFBTree import multiunion
return multiunion(*args)
from BTrees.LFBTree import multiunionPy
return multiunionPy(*args)
def union(self, *args):
from BTrees.LFBTree import union
return union(*args)
from BTrees.LFBTree import unionPy
return unionPy(*args)
def mkset(self, *args):
from BTrees.LFBTree import LFSet as mkset
from BTrees.LFBTree import LFSetPy as mkset
return mkset(*args)
def mktreeset(self, *args):
from BTrees.LFBTree import LFTreeSet as mktreeset
from BTrees.LFBTree import LFTreeSetPy as mktreeset
return mktreeset(*args)
def mkbucket(self, *args):
from BTrees.LFBTree import LFBucket as mkbucket
from BTrees.LFBTree import LFBucketPy as mkbucket
return mkbucket(*args)
def mkbtree(self, *args):
from BTrees.LFBTree import LFBTree as mkbtree
from BTrees.LFBTree import LFBTreePy as mkbtree
return mkbtree(*args)
class TestLFMultiUnionPy(MultiUnion, unittest.TestCase):
def multiunion(self, *args):
from BTrees.LFBTree import multiunionPy
return multiunionPy(*args)
def union(self, *args):
from BTrees.LFBTree import unionPy
return unionPy(*args)
def mkset(self, *args):
from BTrees.LFBTree import LFSetPy as mkset
return mkset(*args)
def mktreeset(self, *args):
from BTrees.LFBTree import LFTreeSetPy as mktreeset
return mktreeset(*args)
def mkbucket(self, *args):
from BTrees.LFBTree import LFBucketPy as mkbucket
return mkbucket(*args)
def mkbtree(self, *args):
from BTrees.LFBTree import LFBTreePy as mkbtree
return mkbtree(*args)
class PureLF(SetResult, unittest.TestCase):
def union(self, *args):
from BTrees.LFBTree import union
return union(*args)
def intersection(self, *args):
from BTrees.LFBTree import intersection
return intersection(*args)
def difference(self, *args):
from BTrees.LFBTree import difference
return difference(*args)
def builders(self):
from BTrees.LFBTree import LFBTree
from BTrees.LFBTree import LFBucket
......@@ -112,6 +194,29 @@ class PureLF(SetResult, unittest.TestCase):
return LFSet, LFTreeSet, makeBuilder(LFBTree), makeBuilder(LFBucket)
class PureLFPy(SetResult, unittest.TestCase):
def union(self, *args):
from BTrees.LFBTree import unionPy
return unionPy(*args)
def intersection(self, *args):
from BTrees.LFBTree import intersectionPy
return intersectionPy(*args)
def difference(self, *args):
from BTrees.LFBTree import differencePy
return differencePy(*args)
def builders(self):
from BTrees.LFBTree import LFBTreePy
from BTrees.LFBTree import LFBucketPy
from BTrees.LFBTree import LFTreeSetPy
from BTrees.LFBTree import LFSetPy
return (LFSetPy, LFTreeSetPy,
makeBuilder(LFBTreePy), makeBuilder(LFBucketPy))
class LFBTreeConflictTests(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -119,6 +224,13 @@ class LFBTreeConflictTests(MappingConflictTestBase, unittest.TestCase):
return LFBTree
class LFBTreeConflictTestsPy(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LFBTree import LFBTreePy
return LFBTreePy
class LFBucketConflictTests(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -126,6 +238,13 @@ class LFBucketConflictTests(MappingConflictTestBase, unittest.TestCase):
return LFBucket
class LFBucketConflictTestsPy(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LFBTree import LFBucketPy
return LFBucketPy
class LFTreeSetConflictTests(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -133,6 +252,13 @@ class LFTreeSetConflictTests(SetConflictTestBase, unittest.TestCase):
return LFTreeSet
class LFTreeSetConflictTestsPy(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LFBTree import LFTreeSetPy
return LFTreeSetPy
class LFSetConflictTests(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -140,6 +266,13 @@ class LFSetConflictTests(SetConflictTestBase, unittest.TestCase):
return LFSet
class LFSetConflictTestsPy(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LFBTree import LFSetPy
return LFSetPy
class LFModuleTest(ModuleTest, unittest.TestCase):
prefix = 'LF'
......@@ -156,16 +289,28 @@ class LFModuleTest(ModuleTest, unittest.TestCase):
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(LFBTreeInternalKeyTest),
unittest.makeSuite(LFBTreePyInternalKeyTest),
unittest.makeSuite(LFTreeSetInternalKeyTest),
unittest.makeSuite(LFTreeSetPyInternalKeyTest),
unittest.makeSuite(LFBucketTest),
unittest.makeSuite(LFBucketPyTest),
unittest.makeSuite(LFTreeSetTest),
unittest.makeSuite(LFTreeSetPyTest),
unittest.makeSuite(LFSetTest),
unittest.makeSuite(LFSetPyTest),
unittest.makeSuite(LFBTreeTest),
unittest.makeSuite(LFBTreePyTest),
unittest.makeSuite(TestLFMultiUnion),
unittest.makeSuite(TestLFMultiUnionPy),
unittest.makeSuite(PureLF),
unittest.makeSuite(PureLFPy),
unittest.makeSuite(LFBTreeConflictTests),
unittest.makeSuite(LFBTreeConflictTestsPy),
unittest.makeSuite(LFBucketConflictTests),
unittest.makeSuite(LFBucketConflictTestsPy),
unittest.makeSuite(LFTreeSetConflictTests),
unittest.makeSuite(LFTreeSetConflictTestsPy),
unittest.makeSuite(LFSetConflictTests),
unittest.makeSuite(LFSetConflictTestsPy),
unittest.makeSuite(LFModuleTest),
))
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