~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

Ensure that ftp transport are always in binary mode.

* bzrlib/transport/ftp/__init__.py:
(FtpStatResult.__init__): Rename 'relpath' parameter to 'baspath'
as this is really midsleading.
(FtpTransport._create_connection): Set binary mode from the start.
(FtpTransport.list_dir): Restore binary mode as ftplib.lnst
doesn't.
(FtpTransport._try_append): No need to force binary mode anymore.

* bzrlib/tests/test_transport_implementations.py:
(TransportTests.test_connect_twice_is_same_content): Mention that
the test is brittle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1115
1115
 
1116
1116
        self.assertListRaises(PathError, t.list_dir, 'q')
1117
1117
        self.assertListRaises(PathError, t.list_dir, 'c/f')
 
1118
        # 'a' is a file, list_dir should raise an error
1118
1119
        self.assertListRaises(PathError, t.list_dir, 'a')
1119
1120
 
1120
1121
    def test_list_dir_result_is_url_escaped(self):
1506
1507
        transport.put_bytes('foo', 'bar')
1507
1508
        transport3 = self.get_transport()
1508
1509
        self.check_transport_contents('bar', transport3, 'foo')
1509
 
        # its base should be usable.
 
1510
        # its base should be usable. XXX: This is true only if we don't use
 
1511
        # auhentication, otherwise 'base' doesn't mention the password and we
 
1512
        # can't access it anymore since the password is lost (it *could* be
 
1513
        # mentioned in the url given by the test server) --vila 090226
1510
1514
        transport4 = get_transport(transport.base)
1511
1515
        self.check_transport_contents('bar', transport4, 'foo')
1512
1516