24
24
# parameterize all tests in this module
25
25
import bzrlib._chunks_to_lines_py as py_module
26
26
scenarios = [('python', {'module': py_module})]
27
if CompiledChunksToLinesFeature.available():
28
import bzrlib._chunks_to_lines_pyx as c_module
29
scenarios.append(('C', {'module': c_module}))
27
if compiled_chunkstolines_feature.available():
28
scenarios.append(('C', {'module':
29
compiled_chunkstolines_feature.module}))
31
31
# the compiled module isn't available, so we add a failing test
32
32
class FailWithoutFeature(tests.TestCase):
33
33
def test_fail(self):
34
self.requireFeature(CompiledChunksToLinesFeature)
34
self.requireFeature(compiled_chunkstolines_feature)
35
35
standard_tests.addTest(FailWithoutFeature("test_fail"))
36
36
return tests.multiply_tests(standard_tests, scenarios, loader.suiteClass())
39
class _CompiledChunksToLinesFeature(tests.Feature):
43
import bzrlib._chunks_to_lines_pyx
48
def feature_name(self):
49
return 'bzrlib._chunks_to_lines_pyx'
51
CompiledChunksToLinesFeature = _CompiledChunksToLinesFeature()
39
compiled_chunkstolines_feature = tests.ModuleAvailableFeature(
40
'bzrlib._chunks_to_lines_pyx')
54
43
class TestChunksToLines(tests.TestCase):