/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 breezy/tests/test_sftp_transport.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-12 01:41:38 UTC
  • mto: (7143.16.20 even-more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7175.
  • Revision ID: jelmer@jelmer.uk-20181112014138-3b0zyx91cu3wdq3k
More PEP8 fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    TestSkipped,
39
39
    )
40
40
from breezy.tests.http_server import HttpServer
41
 
import breezy.transport.http
42
41
 
43
42
if features.paramiko.available():
44
43
    from breezy.transport import sftp as _mod_sftp
220
219
      'loopback': Doesn't use ssh, just uses a local socket. Most tests are
221
220
                  done this way to save the handshaking time, so it is not
222
221
                  tested again here
223
 
      'none':     This uses paramiko's built-in ssh client and server, and layers
224
 
                  sftp on top of it.
 
222
      'none':     This uses paramiko's built-in ssh client and server, and
 
223
                  layers sftp on top of it.
225
224
      None:       If 'ssh' exists on the machine, then it will be spawned as a
226
225
                  child process.
227
226
    """
395
394
 
396
395
    def test_bandwidth(self):
397
396
        sending = FakeSocket()
398
 
        receiving = stub_sftp.SocketDelay(sending, 0, bandwidth=8.0 / (1024 * 1024),
399
 
                                          really_sleep=False)
 
397
        receiving = stub_sftp.SocketDelay(
 
398
            sending, 0, bandwidth=8.0 / (1024 * 1024), really_sleep=False)
400
399
        # check that simulated time is charged only per round-trip:
401
400
        t1 = stub_sftp.SocketDelay.simulated_time
402
401
        receiving.send("connect")
465
464
        # Out of order requests. The requests should get combined, but then be
466
465
        # yielded out-of-order. We also need one that is at the end of a
467
466
        # previous range. See bug #293746
468
 
        self.checkRequestAndYield([(0, b'a'), (10, b'k'), (4, b'efg'), (1, b'bcd')],
469
 
                                  data, [(0, 1), (10, 1), (4, 3), (1, 3)])
 
467
        self.checkRequestAndYield(
 
468
            [(0, b'a'), (10, b'k'), (4, b'efg'), (1, b'bcd')],
 
469
            data, [(0, 1), (10, 1), (4, 3), (1, 3)])
470
470
 
471
471
 
472
472
class TestUsesAuthConfig(TestCaseWithSFTPServer):