~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

MergeĀ upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for Transport implementations.
18
18
 
155
155
        self.assertEqual(True, t.has('a'))
156
156
        self.assertEqual(False, t.has('c'))
157
157
        self.assertEqual(True, t.has(urlutils.escape('%')))
158
 
        self.assertEqual(list(t.has_multi(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'])),
159
 
                [True, True, False, False, True, False, True, False])
 
158
        self.assertEqual(list(t.has_multi(['a', 'b', 'c', 'd',
 
159
                                           'e', 'f', 'g', 'h'])),
 
160
                         [True, True, False, False,
 
161
                          True, False, True, False])
160
162
        self.assertEqual(True, t.has_any(['a', 'b', 'c']))
161
 
        self.assertEqual(False, t.has_any(['c', 'd', 'f', urlutils.escape('%%')]))
162
 
        self.assertEqual(list(t.has_multi(iter(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']))),
163
 
                [True, True, False, False, True, False, True, False])
 
163
        self.assertEqual(False, t.has_any(['c', 'd', 'f',
 
164
                                           urlutils.escape('%%')]))
 
165
        self.assertEqual(list(t.has_multi(iter(['a', 'b', 'c', 'd',
 
166
                                                'e', 'f', 'g', 'h']))),
 
167
                         [True, True, False, False,
 
168
                          True, False, True, False])
164
169
        self.assertEqual(False, t.has_any(['c', 'c', 'c']))
165
170
        self.assertEqual(True, t.has_any(['b', 'b', 'b']))
166
171
 
1495
1500
        transport.put_bytes('foo', 'bar')
1496
1501
        transport3 = self.get_transport()
1497
1502
        self.check_transport_contents('bar', transport3, 'foo')
1498
 
        # its base should be usable. XXX: This is true only if we don't use
1499
 
        # auhentication, otherwise 'base' doesn't mention the password and we
1500
 
        # can't access it anymore since the password is lost (it *could* be
1501
 
        # mentioned in the url given by the test server) --vila 090226
1502
 
        transport4 = get_transport(transport.base)
1503
 
        self.check_transport_contents('bar', transport4, 'foo')
1504
1503
 
1505
1504
        # now opening at a relative url should give use a sane result:
1506
1505
        transport.mkdir('newdir')
1507
 
        transport5 = get_transport(transport.base + "newdir")
 
1506
        transport5 = self.get_transport('newdir')
1508
1507
        transport6 = transport5.clone('..')
1509
1508
        self.check_transport_contents('bar', transport6, 'foo')
1510
1509