~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_sftp_transport.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-10 07:46:15 UTC
  • mfrom: (5844 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5845.
  • Revision ID: jelmer@samba.org-20110510074615-eptod049ndjxc4i7
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
        t = self.get_transport()
73
73
 
74
74
        l = t.lock_write('bogus')
75
 
        self.failUnlessExists('bogus.write-lock')
 
75
        self.assertPathExists('bogus.write-lock')
76
76
 
77
77
        # Don't wait for the lock, locking an already locked
78
78
        # file should raise an assert
79
79
        self.assertRaises(LockError, t.lock_write, 'bogus')
80
80
 
81
81
        l.unlock()
82
 
        self.failIf(lexists('bogus.write-lock'))
 
82
        self.assertFalse(lexists('bogus.write-lock'))
83
83
 
84
84
        open('something.write-lock', 'wb').write('fake lock\n')
85
85
        self.assertRaises(LockError, t.lock_write, 'something')
417
417
 
418
418
 
419
419
class ReadvFile(object):
420
 
    """An object that acts like Paramiko's SFTPFile.readv()"""
 
420
    """An object that acts like Paramiko's SFTPFile when readv() is used"""
421
421
 
422
422
    def __init__(self, data):
423
423
        self._data = data
426
426
        for start, length in requests:
427
427
            yield self._data[start:start+length]
428
428
 
 
429
    def close(self):
 
430
        pass
 
431
 
429
432
 
430
433
def _null_report_activity(*a, **k):
431
434
    pass