/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/branch_implementations/test_bound_sftp.py

  • Committer: Robert Collins
  • Date: 2007-04-23 02:29:35 UTC
  • mfrom: (2441 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2442.
  • Revision ID: robertc@robertcollins.net-20070423022935-9hhongamvk6bfdso
Resolve conflicts with bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
                           BzrDirMetaFormat1,
31
31
                           )
32
32
import bzrlib.errors as errors
33
 
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer, paramiko_loaded
34
 
 
35
 
 
36
 
class BoundSFTPBranch(TestCaseWithSFTPServer):
 
33
from bzrlib.tests import TestSkipped
 
34
from bzrlib.tests import TestCaseWithTransport
 
35
from bzrlib.transport.local import LocalURLServer
 
36
from bzrlib.transport.memory import MemoryServer
 
37
 
 
38
 
 
39
class BoundSFTPBranch(TestCaseWithTransport):
 
40
 
 
41
    def setUp(self):
 
42
        TestCaseWithTransport.setUp(self)
 
43
        self.vfs_transport_factory = MemoryServer
 
44
        if self.transport_server is LocalURLServer:
 
45
            self.transport_server = None
37
46
 
38
47
    def create_branches(self):
39
48
        self.build_tree(['base/', 'base/a', 'base/b'])
40
49
        format = bzrdir.format_registry.make_bzrdir('knit')
41
 
        wt_base = BzrDir.create_standalone_workingtree('base',
42
 
            format=format)
 
50
        try:
 
51
            wt_base = BzrDir.create_standalone_workingtree(
 
52
                self.get_url('base'), format=format)
 
53
        except errors.NotLocalUrl:
 
54
            raise TestSkipped('Not a local URL')
43
55
    
44
56
        b_base = wt_base.branch
45
57
 
55
67
        self.assertEqual(['r@b-1'], wt_child.branch.revision_history())
56
68
        return b_base, wt_child
57
69
 
58
 
    def tearDown(self):
59
 
        self.sftp_base = None
60
 
        bzrlib.transport.sftp.clear_connection_cache()
61
 
        super(BoundSFTPBranch, self).tearDown()
62
 
 
63
70
    def test_simple_binding(self):
64
71
        self.build_tree(['base/', 'base/a', 'base/b', 'child/'])
65
 
        wt_base = BzrDir.create_standalone_workingtree('base')
 
72
        try:
 
73
            wt_base = BzrDir.create_standalone_workingtree(self.get_url('base'))
 
74
        except errors.NotLocalUrl:
 
75
            raise TestSkipped('Not a local URL')
66
76
 
67
77
        wt_base.add('a')
68
78
        wt_base.add('b')
325
335
    #       performance even when something fails.
326
336
 
327
337
 
328
 
if not paramiko_loaded:
329
 
    del BoundSFTPBranch
330