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