~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2004, 2005, 2006 by Canonical Ltd
2
 
 
 
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
7
 
 
 
7
#
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
# GNU General Public License for more details.
12
 
 
 
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
956
956
        self.assertEqual(d[2], (3, '34'))
957
957
        self.assertEqual(d[3], (9, '9'))
958
958
 
 
959
    def test_readv_out_of_order(self):
 
960
        transport = self.get_transport()
 
961
        if transport.is_readonly():
 
962
            file('a', 'w').write('0123456789')
 
963
        else:
 
964
            transport.put('a', StringIO('01234567890'))
 
965
 
 
966
        d = list(transport.readv('a', ((1, 1), (9, 1), (0, 1), (3, 2))))
 
967
        self.assertEqual(d[0], (1, '1'))
 
968
        self.assertEqual(d[1], (9, '9'))
 
969
        self.assertEqual(d[2], (0, '0'))
 
970
        self.assertEqual(d[3], (3, '34'))