~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_btree_index.py

  • Committer: Jelmer Vernooij
  • Date: 2010-12-20 11:57:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5577.
  • Revision ID: jelmer@samba.org-20101220115714-2ru3hfappjweeg7q
Don't use no-plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    )
32
32
from bzrlib.tests import (
33
33
    TestCaseWithTransport,
34
 
    condition_isinstance,
35
 
    multiply_tests,
36
 
    split_suite_by_condition,
 
34
    scenarios,
37
35
    )
38
36
 
39
37
 
40
 
def load_tests(standard_tests, module, loader):
41
 
    # parameterise the TestBTreeNodes tests
42
 
    node_tests, others = split_suite_by_condition(standard_tests,
43
 
        condition_isinstance(TestBTreeNodes))
 
38
load_tests = scenarios.load_tests_apply_scenarios
 
39
 
 
40
 
 
41
def btreeparser_scenarios():
44
42
    import bzrlib._btree_serializer_py as py_module
45
43
    scenarios = [('python', {'parse_btree': py_module})]
46
44
    if compiled_btreeparser_feature.available():
47
 
        scenarios.append(('C', {'parse_btree':
48
 
                                compiled_btreeparser_feature.module}))
49
 
    return multiply_tests(node_tests, scenarios, others)
 
45
        scenarios.append(('C', 
 
46
            {'parse_btree': compiled_btreeparser_feature.module}))
 
47
    return scenarios
50
48
 
51
49
 
52
50
compiled_btreeparser_feature = tests.ModuleAvailableFeature(
53
 
                                'bzrlib._btree_serializer_pyx')
 
51
    'bzrlib._btree_serializer_pyx')
54
52
 
55
53
 
56
54
class BTreeTestCase(TestCaseWithTransport):
1185
1183
 
1186
1184
class TestBTreeNodes(BTreeTestCase):
1187
1185
 
 
1186
    scenarios = btreeparser_scenarios()
 
1187
 
1188
1188
    def setUp(self):
1189
1189
        BTreeTestCase.setUp(self)
1190
1190
        self.overrideAttr(btree_index, '_btree_serializer', self.parse_btree)