Commit 753416e8 authored by Tres Seaver's avatar Tres Seaver

Test pure-Python IO entities everywhere.

parent 4fd37b0d
......@@ -37,6 +37,7 @@ from BTrees.IFBTree import IFBTreePy, IFBucketPy, IFSetPy, IFTreeSetPy
from BTrees.IIBTree import IIBTree, IIBucket, IISet, IITreeSet
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.LLBTree import LLBTree, LLBucket, LLSet, LLTreeSet
from BTrees.LOBTree import LOBTree, LOBucket, LOSet, LOTreeSet
......
......@@ -38,6 +38,13 @@ class IOBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return IOBTree
class IOBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IOBTree import IOBTreePy
return IOBTreePy
class IOTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
......@@ -45,6 +52,13 @@ class IOTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
return IOTreeSet
class IOTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IOBTree import IOTreeSetPy
return IOTreeSetPy
class IOBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -52,6 +66,13 @@ class IOBucketTest(MappingBase, unittest.TestCase):
return IOBucket
class IOBucketPyTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IOBTree import IOBucketPy
return IOBucketPy
class IOTreeSetTest(NormalSetTests, unittest.TestCase):
def _getTargetClass(self):
......@@ -59,6 +80,13 @@ class IOTreeSetTest(NormalSetTests, unittest.TestCase):
return IOTreeSet
class IOTreeSetPyTest(NormalSetTests, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IOBTree import IOTreeSetPy
return IOTreeSetPy
class IOSetTest(ExtendedSetTests, unittest.TestCase):
def _getTargetClass(self):
......@@ -66,25 +94,45 @@ class IOSetTest(ExtendedSetTests, unittest.TestCase):
return IOSet
class IOSetPyTest(ExtendedSetTests, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IOBTree import IOSetPy
return IOSetPy
class IOBTreeTest(BTreeTests, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOBTree
return IOBTree()
class IOBTreePyTest(BTreeTests, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOBTreePy
return IOBTreePy()
if using64bits:
class IOBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOBTree
return IOBTree()
class TestIOBTrees(TypeTest, unittest.TestCase):
class IOBTreePyTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOBTree
return IOBTree()
from BTrees.IOBTree import IOBTreePy
return IOBTreePy()
class _TestIOBTreesBase(TypeTest):
def _stringraises(self):
self._makeOne()['c'] = 1
......@@ -96,6 +144,20 @@ class TestIOBTrees(TypeTest, unittest.TestCase):
self._makeOne()[None] = 1
class TestIOBTrees(_TestIOBTreesBase, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOBTree
return IOBTree()
class TestIOBTreesPy(_TestIOBTreesBase, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOBTreePy
return IOBTreePy()
class TestIOSets(I_SetsBase, unittest.TestCase):
def _makeOne(self):
......@@ -103,22 +165,41 @@ class TestIOSets(I_SetsBase, unittest.TestCase):
return IOSet()
class TestIOSetsPy(I_SetsBase, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOSetPy
return IOSetPy()
class TestIOTreeSets(I_SetsBase, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOTreeSet
return IOTreeSet()
class TestIOTreeSetsPy(I_SetsBase, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOTreeSetPy
return IOTreeSetPy()
class PureIO(SetResult, unittest.TestCase):
def union(self, *args):
from BTrees.IOBTree import union
return union(*args)
def intersection(self, *args):
from BTrees.IOBTree import intersection
return intersection(*args)
def difference(self, *args):
from BTrees.IOBTree import difference
return difference(*args)
def builders(self):
from BTrees.IOBTree import IOBTree
from BTrees.IOBTree import IOBucket
......@@ -126,27 +207,84 @@ class PureIO(SetResult, unittest.TestCase):
from BTrees.IOBTree import IOSet
return IOSet, IOTreeSet, makeBuilder(IOBTree), makeBuilder(IOBucket)
class PureIOPy(SetResult, unittest.TestCase):
def union(self, *args):
from BTrees.IOBTree import unionPy
return unionPy(*args)
def intersection(self, *args):
from BTrees.IOBTree import intersectionPy
return intersectionPy(*args)
def difference(self, *args):
from BTrees.IOBTree import differencePy
return differencePy(*args)
def builders(self):
from BTrees.IOBTree import IOBTreePy
from BTrees.IOBTree import IOBucketPy
from BTrees.IOBTree import IOTreeSetPy
from BTrees.IOBTree import IOSetPy
return (IOSetPy, IOTreeSetPy,
makeBuilder(IOBTreePy), makeBuilder(IOBucketPy))
class TestIOMultiUnion(MultiUnion, unittest.TestCase):
def multiunion(self, *args):
from BTrees.IOBTree import multiunion
return multiunion(*args)
def union(self, *args):
from BTrees.IOBTree import union
return union(*args)
def mkset(self, *args):
from BTrees.IOBTree import IOSet as mkset
return mkset(*args)
def mktreeset(self, *args):
from BTrees.IOBTree import IOTreeSet as mktreeset
return mktreeset(*args)
def mkbucket(self, *args):
from BTrees.IOBTree import IOBucket as mkbucket
return mkbucket(*args)
def mkbtree(self, *args):
from BTrees.IOBTree import IOBTree as mkbtree
return mkbtree(*args)
class TestIOMultiUnionPy(MultiUnion, unittest.TestCase):
def multiunion(self, *args):
from BTrees.IOBTree import multiunionPy
return multiunionPy(*args)
def union(self, *args):
from BTrees.IOBTree import unionPy
return unionPy(*args)
def mkset(self, *args):
from BTrees.IOBTree import IOSetPy as mkset
return mkset(*args)
def mktreeset(self, *args):
from BTrees.IOBTree import IOTreeSetPy as mktreeset
return mktreeset(*args)
def mkbucket(self, *args):
from BTrees.IOBTree import IOBucketPy as mkbucket
return mkbucket(*args)
def mkbtree(self, *args):
from BTrees.IOBTree import IOBTreePy as mkbtree
return mkbtree(*args)
class IOBTreeConflictTests(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -154,6 +292,13 @@ class IOBTreeConflictTests(MappingConflictTestBase, unittest.TestCase):
return IOBTree
class IOBTreeConflictTestsPy(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IOBTree import IOBTreePy
return IOBTreePy
class IOBucketConflictTests(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -161,6 +306,13 @@ class IOBucketConflictTests(MappingConflictTestBase, unittest.TestCase):
return IOBucket
class IOBucketConflictTestsPy(MappingConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IOBTree import IOBucketPy
return IOBucketPy
class IOTreeSetConflictTests(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -168,6 +320,13 @@ class IOTreeSetConflictTests(SetConflictTestBase, unittest.TestCase):
return IOTreeSet
class IOTreeSetConflictTestsPy(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IOBTree import IOTreeSetPy
return IOTreeSetPy
class IOSetConflictTests(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -175,6 +334,13 @@ class IOSetConflictTests(SetConflictTestBase, unittest.TestCase):
return IOSet
class IOSetConflictTestsPy(SetConflictTestBase, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IOBTree import IOSetPy
return IOSetPy
class IOModuleTest(ModuleTest, unittest.TestCase):
prefix = 'IO'
......@@ -207,19 +373,34 @@ class IOModuleTest(ModuleTest, unittest.TestCase):
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(IOBTreeInternalKeyTest),
unittest.makeSuite(IOBTreePyInternalKeyTest),
unittest.makeSuite(IOTreeSetInternalKeyTest),
unittest.makeSuite(IOTreeSetPyInternalKeyTest),
unittest.makeSuite(IOBucketTest),
unittest.makeSuite(IOBucketPyTest),
unittest.makeSuite(IOTreeSetTest),
unittest.makeSuite(IOTreeSetPyTest),
unittest.makeSuite(IOSetTest),
unittest.makeSuite(IOSetPyTest),
unittest.makeSuite(IOBTreeTest),
unittest.makeSuite(IOBTreePyTest),
unittest.makeSuite(TestIOBTrees),
unittest.makeSuite(TestIOBTreesPy),
unittest.makeSuite(TestIOSets),
unittest.makeSuite(TestIOSetsPy),
unittest.makeSuite(TestIOTreeSets),
unittest.makeSuite(TestIOTreeSetsPy),
unittest.makeSuite(TestIOMultiUnion),
unittest.makeSuite(TestIOMultiUnionPy),
unittest.makeSuite(PureIO),
unittest.makeSuite(PureIOPy),
unittest.makeSuite(IOBTreeConflictTests),
unittest.makeSuite(IOBTreeConflictTestsPy),
unittest.makeSuite(IOBucketConflictTests),
unittest.makeSuite(IOBucketConflictTestsPy),
unittest.makeSuite(IOTreeSetConflictTests),
unittest.makeSuite(IOTreeSetConflictTestsPy),
unittest.makeSuite(IOSetConflictTests),
unittest.makeSuite(IOSetConflictTestsPy),
unittest.makeSuite(IOModuleTest),
))
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