~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_selftest.py

Fixed test_selftest's use of sftp

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
"""UI tests for the test framework."""
17
17
 
18
18
import bzrlib
 
19
from bzrlib.errors import ParamikoNotPresent
19
20
from bzrlib.tests import (
20
21
                          TestCase,
21
22
                          TestCaseInTempDir,
30
31
    def test_transport_set_to_sftp(self):
31
32
        # test the --transport option has taken effect from within the
32
33
        # test_transport test
33
 
        import bzrlib.transport.sftp
 
34
        try:
 
35
            import bzrlib.transport.sftp
 
36
        except ParamikoNotPresent:
 
37
            raise TestSkipped("Paramiko not present")
34
38
        if TestOptions.current_test != "test_transport_set_to_sftp":
35
39
            return
36
40
        self.assertEqual(bzrlib.transport.sftp.SFTPAbsoluteServer,
47
51
 
48
52
    def test_transport(self):
49
53
        # test that --transport=sftp works
50
 
        # FIXME RBC 20060123 this should raise TestSkipped if sftp is not
51
 
        # available.
 
54
        try:
 
55
            import bzrlib.transport.sftp
 
56
        except ParamikoNotPresent:
 
57
            raise TestSkipped("Paramiko not present")
52
58
        old_transport = bzrlib.tests.default_transport
53
59
        old_root = TestCaseInTempDir.TEST_ROOT
54
60
        TestCaseInTempDir.TEST_ROOT = None