Commit 60352f47 authored by Tres Seaver's avatar Tres Seaver

Move LF-related set-op tests into LO test module.

parent c1b2568f
......@@ -53,23 +53,6 @@ class PureOI(SetResult, unittest.TestCase):
from BTrees.OIBTree import OISet
return OISet, OITreeSet, makeBuilder(OIBTree), makeBuilder(OIBucket)
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
from BTrees.LFBTree import LFTreeSet
from BTrees.LFBTree import LFSet
return LFSet, LFTreeSet, makeBuilder(LFBTree), makeBuilder(LFBucket)
class PureOL(SetResult, unittest.TestCase):
def union(self, *args):
from BTrees.OLBTree import union
......@@ -87,26 +70,6 @@ class PureOL(SetResult, unittest.TestCase):
from BTrees.OLBTree import OLSet
return OLSet, OLTreeSet, makeBuilder(OLBTree), makeBuilder(OLBucket)
class TestLFMultiUnion(MultiUnion, unittest.TestCase):
def multiunion(self, *args):
from BTrees.LFBTree import multiunion
return multiunion(*args)
def union(self, *args):
from BTrees.LFBTree import union
return union(*args)
def mkset(self, *args):
from BTrees.LFBTree import LFSet as mkset
return mkset(*args)
def mktreeset(self, *args):
from BTrees.LFBTree import LFTreeSet as mktreeset
return mktreeset(*args)
def mkbucket(self, *args):
from BTrees.LFBTree import LFBucket as mkbucket
return mkbucket(*args)
def mkbtree(self, *args):
from BTrees.LFBTree import LFBTree as mkbtree
return mkbtree(*args)
# Check that various special module functions are and aren't imported from
# the expected BTree modules.
class TestImports(unittest.TestCase):
......@@ -244,9 +207,6 @@ class TestWeightedOL(Weighted, unittest.TestCase):
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(TestLFMultiUnion),
unittest.makeSuite(PureLF),
unittest.makeSuite(PureOO),
unittest.makeSuite(PureOI),
......
......@@ -13,15 +13,17 @@
##############################################################################
import unittest
from BTrees.tests.common import BTreeTests
from BTrees.tests.common import ExtendedSetTests
from BTrees.tests.common import I_SetsBase
from BTrees.tests.common import InternalKeysMappingTest
from BTrees.tests.common import InternalKeysSetTest
from BTrees.tests.common import MappingBase
from BTrees.tests.common import ModuleTest
from BTrees.tests.common import NormalSetTests
from BTrees.tests.common import TestLongIntKeys
from .common import BTreeTests
from .common import ExtendedSetTests
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import MappingBase
from .common import ModuleTest
from .common import MultiUnion
from .common import NormalSetTests
from .common import SetResult
from .common import TestLongIntKeys
from .common import makeBuilder
class LFBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
......@@ -82,6 +84,45 @@ class LFBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
return 0.5, 1.5
class TestLFMultiUnion(MultiUnion, unittest.TestCase):
def multiunion(self, *args):
from BTrees.LFBTree import multiunion
return multiunion(*args)
def union(self, *args):
from BTrees.LFBTree import union
return union(*args)
def mkset(self, *args):
from BTrees.LFBTree import LFSet as mkset
return mkset(*args)
def mktreeset(self, *args):
from BTrees.LFBTree import LFTreeSet as mktreeset
return mktreeset(*args)
def mkbucket(self, *args):
from BTrees.LFBTree import LFBucket as mkbucket
return mkbucket(*args)
def mkbtree(self, *args):
from BTrees.LFBTree import LFBTree 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
from BTrees.LFBTree import LFTreeSet
from BTrees.LFBTree import LFSet
return LFSet, LFTreeSet, makeBuilder(LFBTree), makeBuilder(LFBucket)
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(LFBTreeInternalKeyTest),
......@@ -91,4 +132,7 @@ def test_suite():
unittest.makeSuite(LFSetTest),
unittest.makeSuite(LFModuleTest),
unittest.makeSuite(LFBTreeTest),
unittest.makeSuite(TestLFMultiUnion),
unittest.makeSuite(PureLF),
))
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