~ubuntu-branches/ubuntu/karmic/bzr/karmic-proposed

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_sftp_transport.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-02-14 00:24:06 UTC
  • mfrom: (1.1.48 upstream)
  • Revision ID: james.westby@ubuntu.com-20090214002406-h2zfezq54iylm2w8
Tags: 1.12-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
474
474
            yield self._data[start:start+length]
475
475
 
476
476
 
 
477
def _null_report_activity(*a, **k):
 
478
    pass
 
479
 
 
480
 
477
481
class Test_SFTPReadvHelper(tests.TestCase):
478
482
 
479
483
    def checkGetRequests(self, expected_requests, offsets):
480
484
        if not paramiko_loaded:
481
485
            raise TestSkipped('you must have paramiko to run this test')
482
 
        helper = _mod_sftp._SFTPReadvHelper(offsets, 'artificial_test')
 
486
        helper = _mod_sftp._SFTPReadvHelper(offsets, 'artificial_test',
 
487
            _null_report_activity)
483
488
        self.assertEqual(expected_requests, helper._get_requests())
484
489
 
485
490
    def test__get_requests(self):
499
504
    def checkRequestAndYield(self, expected, data, offsets):
500
505
        if not paramiko_loaded:
501
506
            raise TestSkipped('you must have paramiko to run this test')
502
 
        helper = _mod_sftp._SFTPReadvHelper(offsets, 'artificial_test')
 
507
        helper = _mod_sftp._SFTPReadvHelper(offsets, 'artificial_test',
 
508
            _null_report_activity)
503
509
        data_f = ReadvFile(data)
504
510
        result = list(helper.request_and_yield_offsets(data_f))
505
511
        self.assertEqual(expected, result)