Commit 001d4c17 authored by Tres Seaver's avatar Tres Seaver

Test pure-Python LO entities everywhere.

parent 416dc861
...@@ -43,6 +43,7 @@ from BTrees.LFBTree import LFBTreePy, LFBucketPy, LFSetPy, LFTreeSetPy ...@@ -43,6 +43,7 @@ from BTrees.LFBTree import LFBTreePy, LFBucketPy, LFSetPy, LFTreeSetPy
from BTrees.LLBTree import LLBTree, LLBucket, LLSet, LLTreeSet from BTrees.LLBTree import LLBTree, LLBucket, LLSet, LLTreeSet
from BTrees.LLBTree import LLBTreePy, LLBucketPy, LLSetPy, LLTreeSetPy from BTrees.LLBTree import LLBTreePy, LLBucketPy, LLSetPy, LLTreeSetPy
from BTrees.LOBTree import LOBTree, LOBucket, LOSet, LOTreeSet from BTrees.LOBTree import LOBTree, LOBucket, LOSet, LOTreeSet
from BTrees.LOBTree import LOBTreePy, LOBucketPy, LOSetPy, LOTreeSetPy
from BTrees.OIBTree import OIBTree, OIBucket, OISet, OITreeSet from BTrees.OIBTree import OIBTree, OIBucket, OISet, OITreeSet
from BTrees.OIBTree import OIBTreePy, OIBucketPy, OISetPy, OITreeSetPy from BTrees.OIBTree import OIBTreePy, OIBucketPy, OISetPy, OITreeSetPy
from BTrees.OLBTree import OLBTree, OLBucket, OLSet, OLTreeSet from BTrees.OLBTree import OLBTree, OLBucket, OLSet, OLTreeSet
......
...@@ -36,6 +36,13 @@ class LOBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase): ...@@ -36,6 +36,13 @@ class LOBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return LOBTree return LOBTree
class LOBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LOBTree import LOBTreePy
return LOBTreePy
class LOTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase): class LOTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self): def _getTargetClass(self):
...@@ -43,6 +50,13 @@ class LOTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase): ...@@ -43,6 +50,13 @@ class LOTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
return LOTreeSet return LOTreeSet
class LOTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LOBTree import LOTreeSetPy
return LOTreeSetPy
class LOBucketTest(MappingBase, unittest.TestCase): class LOBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self): def _getTargetClass(self):
...@@ -50,6 +64,13 @@ class LOBucketTest(MappingBase, unittest.TestCase): ...@@ -50,6 +64,13 @@ class LOBucketTest(MappingBase, unittest.TestCase):
return LOBucket return LOBucket
class LOBucketPyTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LOBTree import LOBucketPy
return LOBucketPy
class LOTreeSetTest(NormalSetTests, unittest.TestCase): class LOTreeSetTest(NormalSetTests, unittest.TestCase):
def _getTargetClass(self): def _getTargetClass(self):
...@@ -57,6 +78,13 @@ class LOTreeSetTest(NormalSetTests, unittest.TestCase): ...@@ -57,6 +78,13 @@ class LOTreeSetTest(NormalSetTests, unittest.TestCase):
return LOTreeSet return LOTreeSet
class LOTreeSetPyTest(NormalSetTests, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LOBTree import LOTreeSetPy
return LOTreeSetPy
class LOSetTest(ExtendedSetTests, unittest.TestCase): class LOSetTest(ExtendedSetTests, unittest.TestCase):
def _getTargetClass(self): def _getTargetClass(self):
...@@ -64,6 +92,12 @@ class LOSetTest(ExtendedSetTests, unittest.TestCase): ...@@ -64,6 +92,12 @@ class LOSetTest(ExtendedSetTests, unittest.TestCase):
return LOSet return LOSet
class LOSetPyTest(ExtendedSetTests, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LOBTree import LOSetPy
return LOSetPy
class LOBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase): class LOBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
...@@ -72,6 +106,13 @@ class LOBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase): ...@@ -72,6 +106,13 @@ class LOBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
return LOBTree() return LOBTree()
class LOBTreePyTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.LOBTree import LOBTreePy
return LOBTreePy()
class TestLOSets(I_SetsBase, unittest.TestCase): class TestLOSets(I_SetsBase, unittest.TestCase):
def _makeOne(self): def _makeOne(self):
...@@ -79,6 +120,13 @@ class TestLOSets(I_SetsBase, unittest.TestCase): ...@@ -79,6 +120,13 @@ class TestLOSets(I_SetsBase, unittest.TestCase):
return LOSet() return LOSet()
class TestLOSetsPy(I_SetsBase, unittest.TestCase):
def _makeOne(self):
from BTrees.LOBTree import LOSetPy
return LOSetPy()
class TestLOTreeSets(I_SetsBase, unittest.TestCase): class TestLOTreeSets(I_SetsBase, unittest.TestCase):
def _makeOne(self): def _makeOne(self):
...@@ -86,37 +134,81 @@ class TestLOTreeSets(I_SetsBase, unittest.TestCase): ...@@ -86,37 +134,81 @@ class TestLOTreeSets(I_SetsBase, unittest.TestCase):
return LOTreeSet() return LOTreeSet()
class TestLOTreeSetsPy(I_SetsBase, unittest.TestCase):
def _makeOne(self):
from BTrees.LOBTree import LOTreeSetPy
return LOTreeSetPy()
class TestLOMultiUnion(MultiUnion, unittest.TestCase): class TestLOMultiUnion(MultiUnion, unittest.TestCase):
def multiunion(self, *args): def multiunion(self, *args):
from BTrees.LOBTree import multiunion from BTrees.LOBTree import multiunion
return multiunion(*args) return multiunion(*args)
def union(self, *args): def union(self, *args):
from BTrees.LOBTree import union from BTrees.LOBTree import union
return union(*args) return union(*args)
def mkset(self, *args): def mkset(self, *args):
from BTrees.LOBTree import LOSet as mkset from BTrees.LOBTree import LOSet as mkset
return mkset(*args) return mkset(*args)
def mktreeset(self, *args): def mktreeset(self, *args):
from BTrees.LOBTree import LOTreeSet as mktreeset from BTrees.LOBTree import LOTreeSet as mktreeset
return mktreeset(*args) return mktreeset(*args)
def mkbucket(self, *args): def mkbucket(self, *args):
from BTrees.LOBTree import LOBucket as mkbucket from BTrees.LOBTree import LOBucket as mkbucket
return mkbucket(*args) return mkbucket(*args)
def mkbtree(self, *args): def mkbtree(self, *args):
from BTrees.LOBTree import LOBTree as mkbtree from BTrees.LOBTree import LOBTree as mkbtree
return mkbtree(*args) return mkbtree(*args)
class TestLOMultiUnionPy(MultiUnion, unittest.TestCase):
def multiunion(self, *args):
from BTrees.LOBTree import multiunionPy
return multiunionPy(*args)
def union(self, *args):
from BTrees.LOBTree import unionPy
return unionPy(*args)
def mkset(self, *args):
from BTrees.LOBTree import LOSetPy as mkset
return mkset(*args)
def mktreeset(self, *args):
from BTrees.LOBTree import LOTreeSetPy as mktreeset
return mktreeset(*args)
def mkbucket(self, *args):
from BTrees.LOBTree import LOBucketPy as mkbucket
return mkbucket(*args)
def mkbtree(self, *args):
from BTrees.LOBTree import LOBTreePy as mkbtree
return mkbtree(*args)
class PureLO(SetResult, unittest.TestCase): class PureLO(SetResult, unittest.TestCase):
def union(self, *args): def union(self, *args):
from BTrees.LOBTree import union from BTrees.LOBTree import union
return union(*args) return union(*args)
def intersection(self, *args): def intersection(self, *args):
from BTrees.LOBTree import intersection from BTrees.LOBTree import intersection
return intersection(*args) return intersection(*args)
def difference(self, *args): def difference(self, *args):
from BTrees.LOBTree import difference from BTrees.LOBTree import difference
return difference(*args) return difference(*args)
def builders(self): def builders(self):
from BTrees.LOBTree import LOBTree from BTrees.LOBTree import LOBTree
from BTrees.LOBTree import LOBucket from BTrees.LOBTree import LOBucket
...@@ -125,6 +217,29 @@ class PureLO(SetResult, unittest.TestCase): ...@@ -125,6 +217,29 @@ class PureLO(SetResult, unittest.TestCase):
return LOSet, LOTreeSet, makeBuilder(LOBTree), makeBuilder(LOBucket) return LOSet, LOTreeSet, makeBuilder(LOBTree), makeBuilder(LOBucket)
class PureLOPy(SetResult, unittest.TestCase):
def union(self, *args):
from BTrees.LOBTree import unionPy
return unionPy(*args)
def intersection(self, *args):
from BTrees.LOBTree import intersectionPy
return intersectionPy(*args)
def difference(self, *args):
from BTrees.LOBTree import differencePy
return differencePy(*args)
def builders(self):
from BTrees.LOBTree import LOBTreePy
from BTrees.LOBTree import LOBucketPy
from BTrees.LOBTree import LOTreeSetPy
from BTrees.LOBTree import LOSetPy
return (LOSetPy, LOTreeSetPy,
makeBuilder(LOBTreePy), makeBuilder(LOBucketPy))
class LOBTreeConflictTests(MappingConflictTestBase, unittest.TestCase): class LOBTreeConflictTests(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self): def _getTargetClass(self):
...@@ -132,6 +247,13 @@ class LOBTreeConflictTests(MappingConflictTestBase, unittest.TestCase): ...@@ -132,6 +247,13 @@ class LOBTreeConflictTests(MappingConflictTestBase, unittest.TestCase):
return LOBTree return LOBTree
class LOBTreeConflictTestsPy(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LOBTree import LOBTreePy
return LOBTreePy
class LOBucketConflictTests(MappingConflictTestBase, unittest.TestCase): class LOBucketConflictTests(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self): def _getTargetClass(self):
...@@ -139,6 +261,13 @@ class LOBucketConflictTests(MappingConflictTestBase, unittest.TestCase): ...@@ -139,6 +261,13 @@ class LOBucketConflictTests(MappingConflictTestBase, unittest.TestCase):
return LOBucket return LOBucket
class LOBucketConflictTestsPy(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LOBTree import LOBucketPy
return LOBucketPy
class LOTreeSetConflictTests(SetConflictTestBase, unittest.TestCase): class LOTreeSetConflictTests(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self): def _getTargetClass(self):
...@@ -146,6 +275,13 @@ class LOTreeSetConflictTests(SetConflictTestBase, unittest.TestCase): ...@@ -146,6 +275,13 @@ class LOTreeSetConflictTests(SetConflictTestBase, unittest.TestCase):
return LOTreeSet return LOTreeSet
class LOTreeSetConflictTestsPy(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LOBTree import LOTreeSetPy
return LOTreeSetPy
class LOSetConflictTests(SetConflictTestBase, unittest.TestCase): class LOSetConflictTests(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self): def _getTargetClass(self):
...@@ -153,6 +289,13 @@ class LOSetConflictTests(SetConflictTestBase, unittest.TestCase): ...@@ -153,6 +289,13 @@ class LOSetConflictTests(SetConflictTestBase, unittest.TestCase):
return LOSet return LOSet
class LOSetConflictTestsPy(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LOBTree import LOSetPy
return LOSetPy
class LOModuleTest(ModuleTest, unittest.TestCase): class LOModuleTest(ModuleTest, unittest.TestCase):
prefix = 'LO' prefix = 'LO'
...@@ -185,18 +328,32 @@ class LOModuleTest(ModuleTest, unittest.TestCase): ...@@ -185,18 +328,32 @@ class LOModuleTest(ModuleTest, unittest.TestCase):
def test_suite(): def test_suite():
return unittest.TestSuite(( return unittest.TestSuite((
unittest.makeSuite(LOBTreeInternalKeyTest), unittest.makeSuite(LOBTreeInternalKeyTest),
unittest.makeSuite(LOBTreePyInternalKeyTest),
unittest.makeSuite(LOTreeSetInternalKeyTest), unittest.makeSuite(LOTreeSetInternalKeyTest),
unittest.makeSuite(LOTreeSetPyInternalKeyTest),
unittest.makeSuite(LOBucketTest), unittest.makeSuite(LOBucketTest),
unittest.makeSuite(LOBucketPyTest),
unittest.makeSuite(LOTreeSetTest), unittest.makeSuite(LOTreeSetTest),
unittest.makeSuite(LOTreeSetPyTest),
unittest.makeSuite(LOSetTest), unittest.makeSuite(LOSetTest),
unittest.makeSuite(LOSetPyTest),
unittest.makeSuite(LOBTreeTest), unittest.makeSuite(LOBTreeTest),
unittest.makeSuite(LOBTreePyTest),
unittest.makeSuite(TestLOSets), unittest.makeSuite(TestLOSets),
unittest.makeSuite(TestLOSetsPy),
unittest.makeSuite(TestLOTreeSets), unittest.makeSuite(TestLOTreeSets),
unittest.makeSuite(TestLOTreeSetsPy),
unittest.makeSuite(TestLOMultiUnion), unittest.makeSuite(TestLOMultiUnion),
unittest.makeSuite(TestLOMultiUnionPy),
unittest.makeSuite(PureLO), unittest.makeSuite(PureLO),
unittest.makeSuite(PureLOPy),
unittest.makeSuite(LOBTreeConflictTests), unittest.makeSuite(LOBTreeConflictTests),
unittest.makeSuite(LOBTreeConflictTestsPy),
unittest.makeSuite(LOBucketConflictTests), unittest.makeSuite(LOBucketConflictTests),
unittest.makeSuite(LOBucketConflictTestsPy),
unittest.makeSuite(LOTreeSetConflictTests), unittest.makeSuite(LOTreeSetConflictTests),
unittest.makeSuite(LOTreeSetConflictTestsPy),
unittest.makeSuite(LOSetConflictTests), unittest.makeSuite(LOSetConflictTests),
unittest.makeSuite(LOSetConflictTestsPy),
unittest.makeSuite(LOModuleTest), unittest.makeSuite(LOModuleTest),
)) ))
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