~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_btree_index.py

  • Committer: John Arbash Meinel
  • Date: 2010-09-29 20:56:18 UTC
  • mto: This revision was merged to the branch mainline in revision 5452.
  • Revision ID: john@arbash-meinel.com-20100929205618-qlldxw4ykwt5511n
Move the new NEWS entry to the appropriate section.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    )
32
32
from bzrlib.tests import (
33
33
    TestCaseWithTransport,
34
 
    scenarios,
 
34
    condition_isinstance,
 
35
    multiply_tests,
 
36
    split_suite_by_condition,
35
37
    )
36
38
 
37
39
 
38
 
load_tests = scenarios.load_tests_apply_scenarios
39
 
 
40
 
 
41
 
def btreeparser_scenarios():
 
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))
42
44
    import bzrlib._btree_serializer_py as py_module
43
45
    scenarios = [('python', {'parse_btree': py_module})]
44
46
    if compiled_btreeparser_feature.available():
45
 
        scenarios.append(('C', 
46
 
            {'parse_btree': compiled_btreeparser_feature.module}))
47
 
    return scenarios
 
47
        scenarios.append(('C', {'parse_btree':
 
48
                                compiled_btreeparser_feature.module}))
 
49
    return multiply_tests(node_tests, scenarios, others)
48
50
 
49
51
 
50
52
compiled_btreeparser_feature = tests.ModuleAvailableFeature(
51
 
    'bzrlib._btree_serializer_pyx')
 
53
                                'bzrlib._btree_serializer_pyx')
52
54
 
53
55
 
54
56
class BTreeTestCase(TestCaseWithTransport):
1183
1185
 
1184
1186
class TestBTreeNodes(BTreeTestCase):
1185
1187
 
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)