/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__static_tuple.py

Switch CompiledStaticTuple

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        ('python', {'module': _static_tuple_py}),
37
37
    ]
38
38
    suite = loader.suiteClass()
39
 
    if CompiledStaticTuple.available():
40
 
        from bzrlib import _static_tuple_c
41
 
        scenarios.append(('C', {'module': _static_tuple_c}))
 
39
    if compiled_static_tuple.available():
 
40
        scenarios.append(('C', {'module': compiled_static_tuple.module}))
42
41
    else:
43
42
        # the compiled module isn't available, so we add a failing test
44
43
        class FailWithoutFeature(tests.TestCase):
45
44
            def test_fail(self):
46
 
                self.requireFeature(CompiledStaticTuple)
 
45
                self.requireFeature(compiled_static_tuple)
47
46
        suite.addTest(loader.loadTestsFromTestCase(FailWithoutFeature))
48
47
    result = tests.multiply_tests(standard_tests, scenarios, suite)
49
48
    return result
50
49
 
51
50
 
52
 
class _CompiledStaticTuple(tests.Feature):
53
 
 
54
 
    def _probe(self):
55
 
        try:
56
 
            import bzrlib._static_tuple_c
57
 
        except ImportError:
58
 
            return False
59
 
        return True
60
 
 
61
 
    def feature_name(self):
62
 
        return 'bzrlib._static_tuple_c'
63
 
 
64
 
CompiledStaticTuple = _CompiledStaticTuple()
 
51
compiled_static_tuple = tests.ModuleAvailableFeature('bzrlib._static_tuple_c')
65
52
 
66
53
 
67
54
class _Meliae(tests.Feature):
641
628
        # Make sure the right implementation is available from
642
629
        # bzrlib.static_tuple.StaticTuple.
643
630
        if self.module is _static_tuple_py:
644
 
            if CompiledStaticTuple.available():
 
631
            if compiled_static_tuple.available():
645
632
                # We will be using the C version
646
633
                return
647
634
        self.assertIs(static_tuple.StaticTuple,