~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Robert Collins
  • Date: 2009-12-22 23:09:50 UTC
  • mfrom: (4918 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4920.
  • Revision ID: robertc@robertcollins.net-20091222230950-39gjmost0lmu9ufg
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    deprecated_method,
62
62
    )
63
63
from bzrlib.tests import (
64
 
    SubUnitFeature,
 
64
    features,
65
65
    test_lsprof,
66
66
    test_sftp_transport,
67
67
    TestUtil,
1888
1888
        self.assertEqual(expected.getvalue(), repeated.getvalue())
1889
1889
 
1890
1890
    def test_runner_class(self):
1891
 
        self.requireFeature(SubUnitFeature)
 
1891
        self.requireFeature(features.subunit)
1892
1892
        from subunit import ProtocolTestCase
1893
1893
        stream = self.run_selftest(runner_class=tests.SubUnitBzrRunner,
1894
1894
            test_suite_factory=self.factory)
1926
1926
        self.assertEqual(transport_server, captured_transport[0])
1927
1927
 
1928
1928
    def test_transport_sftp(self):
1929
 
        try:
1930
 
            import bzrlib.transport.sftp
1931
 
        except errors.ParamikoNotPresent:
1932
 
            raise tests.TestSkipped("Paramiko not present")
 
1929
        self.requireFeature(features.paramiko)
1933
1930
        self.check_transport_set(bzrlib.transport.sftp.SFTPAbsoluteServer)
1934
1931
 
1935
1932
    def test_transport_memory(self):
2381
2378
        self.assertIs(feature, exception.args[0])
2382
2379
 
2383
2380
 
 
2381
simple_thunk_feature = tests._CompatabilityThunkFeature(
 
2382
    'bzrlib.tests', 'UnicodeFilename',
 
2383
    'bzrlib.tests.test_selftest.simple_thunk_feature',
 
2384
    deprecated_in((2,1,0)))
 
2385
 
 
2386
class Test_CompatibilityFeature(tests.TestCase):
 
2387
 
 
2388
    def test_does_thunk(self):
 
2389
        res = self.callDeprecated(
 
2390
            ['bzrlib.tests.test_selftest.simple_thunk_feature was deprecated'
 
2391
             ' in version 2.1.0. Use bzrlib.tests.UnicodeFilename instead.'],
 
2392
            simple_thunk_feature.available)
 
2393
        self.assertEqual(tests.UnicodeFilename.available(), res)
 
2394
 
 
2395
        
2384
2396
class TestModuleAvailableFeature(tests.TestCase):
2385
2397
 
2386
2398
    def test_available_module(self):