/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_selftest.py

Add a _CompatibilityThunkFeature.

It sends a DeprecationWarning, and then thunks over to the real feature.
This should make it easier to rename features and move them into
bzrlib.tests.features without breaking plugins, etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    )
54
54
from bzrlib.tests import (
55
55
    features,
56
 
    SubUnitFeature,
57
56
    test_lsprof,
58
57
    test_sftp_transport,
59
58
    TestUtil,
1983
1982
        self.assertEqual(expected.getvalue(), repeated.getvalue())
1984
1983
 
1985
1984
    def test_runner_class(self):
1986
 
        self.requireFeature(SubUnitFeature)
 
1985
        self.requireFeature(features.subunit)
1987
1986
        from subunit import ProtocolTestCase
1988
1987
        stream = self.run_selftest(runner_class=tests.SubUnitBzrRunner,
1989
1988
            test_suite_factory=self.factory)
2495
2494
        self.assertIs(feature, exception.args[0])
2496
2495
 
2497
2496
 
 
2497
simple_thunk_feature = tests._CompatabilityThunkFeature(
 
2498
    'bzrlib.tests', 'UnicodeFilename',
 
2499
    'bzrlib.tests.test_selftest.simple_thunk_feature',
 
2500
    deprecated_in((2,1,0)))
 
2501
 
 
2502
class Test_CompatibilityFeature(tests.TestCase):
 
2503
 
 
2504
    def test_does_thunk(self):
 
2505
        res = self.callDeprecated(
 
2506
            ['bzrlib.tests.test_selftest.simple_thunk_feature was deprecated'
 
2507
             ' in version 2.1.0. Use bzrlib.tests.UnicodeFilename instead.'],
 
2508
            simple_thunk_feature.available)
 
2509
        self.assertEqual(tests.UnicodeFilename.available(), res)
 
2510
 
 
2511
        
2498
2512
class TestModuleAvailableFeature(tests.TestCase):
2499
2513
 
2500
2514
    def test_available_module(self):