~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_sftp_transport.py

Move working tree initialisation out from  Branch.initialize, deprecated Branch.initialize to Branch.create.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.osutils import pathjoin, lexists
24
24
from bzrlib.tests import TestCaseInTempDir, TestCase, TestSkipped
25
25
import bzrlib.transport
 
26
from bzrlib.workingtree import WorkingTree
26
27
 
27
28
try:
28
29
    import paramiko
211
212
 
212
213
    def test_lock_file(self):
213
214
        """Make sure that a Branch accessed over sftp tries to lock itself."""
214
 
        b = Branch.initialize(self._sftp_url)
 
215
        b = Branch.create(self._sftp_url)
215
216
        self.failUnlessExists('.bzr/')
216
217
        self.failUnlessExists('.bzr/branch-format')
217
218
        self.failUnlessExists('.bzr/branch-lock')
223
224
        self.failIf(lexists('.bzr/branch-lock.write-lock'))
224
225
 
225
226
    def test_no_working_tree(self):
226
 
        b = Branch.initialize(self._sftp_url)
 
227
        b = Branch.create(self._sftp_url)
227
228
        self.assertRaises(errors.NoWorkingTree, b.working_tree)
228
229
 
229
230
    def test_push_support(self):
230
231
        self.build_tree(['a/', 'a/foo'])
231
 
        b = Branch.initialize('a')
232
 
        t = b.working_tree()
 
232
        t = WorkingTree.create_standalone('a')
 
233
        b = t.branch
233
234
        t.add('foo')
234
235
        t.commit('foo', rev_id='a1')
235
236
 
236
237
        os.mkdir('b')
237
 
        b2 = Branch.initialize(self._sftp_url + '/b')
 
238
        b2 = Branch.create(self._sftp_url + '/b')
238
239
        b2.pull(b)
239
240
 
240
241
        self.assertEquals(b2.revision_history(), ['a1'])