~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_sftp.py

  • Committer: John Arbash Meinel
  • Date: 2005-12-01 01:31:32 UTC
  • mto: (1185.50.4 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1519.
  • Revision ID: john@arbash-meinel.com-20051201013132-76797e2be4758e1c
Adding tests for remote sftp branches without working trees, plus a bugfix to allow push to still work with a warning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from bzrlib.tests import TestCaseInTempDir, TestCase
22
22
from bzrlib.tests.test_transport import TestTransportMixIn
 
23
import bzrlib.errors as errors
23
24
 
24
25
try:
25
26
    import paramiko
275
276
        b.unlock()
276
277
        self.failIf(os.path.lexists('.bzr/branch-lock.write-lock'))
277
278
 
 
279
    def test_no_working_tree(self):
 
280
        from bzrlib.branch import Branch
 
281
        self.delayed_setup()
 
282
        b = Branch.initialize(self._sftp_url)
 
283
        self.assertRaises(errors.NoWorkingTree, b.working_tree)
 
284
 
 
285
    def test_push_support(self):
 
286
        from bzrlib.branch import Branch
 
287
        self.delayed_setup()
 
288
 
 
289
        self.build_tree(['a/', 'a/foo'])
 
290
        b = Branch.initialize('a')
 
291
        t = b.working_tree()
 
292
        t.add('foo')
 
293
        t.commit('foo', rev_id='a1')
 
294
 
 
295
        os.mkdir('b')
 
296
        b2 = Branch.initialize(self._sftp_url + 'b')
 
297
        b2.pull(b)
 
298
 
 
299
        self.assertEquals(b2.revision_history(), ['a1'])
 
300
 
278
301
 
279
302
if not paramiko_loaded:
280
303
    # TODO: Skip these