Commit 1f6ee132 authored by Tres Seaver's avatar Tres Seaver

Restore coverage after repairing fsBTree conditional imports.

parent 82140acb
......@@ -73,8 +73,6 @@ class fsBTreePy(BTree):
MAX_SIZE = _TREE_SIZE
_to_key = _to_key
_to_value = _to_value
def MERGE_WEIGHT(self, value, weight):
return value
class fsTreeSetPy(TreeSet):
......
......@@ -14,11 +14,7 @@
import unittest
class fsBucketTests(unittest.TestCase):
def _getTargetClass(self):
from BTrees.fsBTree import fsBucket
return fsBucket
class fsBucketBase(object):
def _makeOne(self, *args, **kw):
return self._getTargetClass()(*args, **kw)
......@@ -43,21 +39,22 @@ class fsBucketTests(unittest.TestCase):
self.assertRaises(ValueError, bucket.fromString, 'xxx')
class fsBTreeTests(unittest.TestCase):
class fsBucketTests(unittest.TestCase, fsBucketBase):
def _getTargetClass(self):
from BTrees.fsBTree import fsBTree
return fsBTree
from BTrees.fsBTree import fsBucket
return fsBucket
def _makeOne(self, *args, **kw):
return self._getTargetClass()(*args, **kw)
def test_MERGE_WEIGHT(self):
bucket = self._makeOne()
self.assertEqual(bucket.MERGE_WEIGHT(42, 17), 42)
class fsBucketPyTests(unittest.TestCase, fsBucketBase):
def _getTargetClass(self):
from BTrees.fsBTree import fsBucketPy
return fsBucketPy
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(fsBucketTests),
unittest.makeSuite(fsBucketPyTests),
))
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