~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib import branch, bzrdir
23
23
from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
24
24
from bzrlib.tests.blackbox import ExternalBase
 
25
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
25
26
from bzrlib.workingtree import WorkingTree
26
27
 
27
28
 
89
90
        self.assertTrue(pushed_repo.has_revision('b-1'))
90
91
 
91
92
 
 
93
class TestRemoteBranch(TestCaseWithSFTPServer):
 
94
 
 
95
    def setUp(self):
 
96
        super(TestRemoteBranch, self).setUp()
 
97
        tree = self.make_branch_and_tree('branch')
 
98
        self.build_tree_contents([('branch/file', 'file content\n')])
 
99
        tree.add('file')
 
100
        tree.commit('file created')
 
101
 
 
102
    def test_branch_local_remote(self):
 
103
        self.run_bzr(['branch', 'branch', self.get_url('remote')])
 
104
        t = self.get_transport()
 
105
        # Ensure that no working tree what created remotely
 
106
        self.assertFalse(t.has('remote/file'))
 
107
 
 
108
    def test_branch_remote_remote(self):
 
109
        # Light cheat: we access the branch remotely
 
110
        self.run_bzr(['branch', self.get_url('branch'),
 
111
                      self.get_url('remote')])
 
112
        t = self.get_transport()
 
113
        # Ensure that no working tree what created remotely
 
114
        self.assertFalse(t.has('remote/file'))
 
115