/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 bzrlib/tests/test_remote.py

  • Committer: Andrew Bennetts
  • Date: 2008-01-22 00:27:42 UTC
  • mto: This revision was merged to the branch mainline in revision 3200.
  • Revision ID: andrew.bennetts@canonical.com-20080122002742-jq55lz7umd0bcvx1
Don't transmit URL-escaped relpaths in the smart protocol, which is back to how things worked in bzr 1.1 and earlier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from cStringIO import StringIO
27
27
 
28
28
from bzrlib import (
29
 
    bzrdir,
30
29
    errors,
31
30
    graph,
32
31
    pack,
166
165
        self.base = base
167
166
 
168
167
 
 
168
class TestVfsHas(tests.TestCase):
 
169
 
 
170
    def test_unicode_path(self):
 
171
        client = FakeClient([(('yes',), )], '/')
 
172
        transport = RemoteTransport('bzr://localhost/', _client=client)
 
173
        filename = u'/hell\u00d8'.encode('utf8')
 
174
        result = transport.has(filename)
 
175
        self.assertEqual(
 
176
            [('call', 'has', (filename,))],
 
177
            client._calls)
 
178
        self.assertTrue(result)
 
179
 
 
180
 
169
181
class TestBzrDirOpenBranch(tests.TestCase):
170
182
 
171
183
    def test_branch_present(self):
194
206
            [('call', 'BzrDir.open_branch', ('quack/',))],
195
207
            client._calls)
196
208
 
 
209
    def test_url_quoting_of_path(self):
 
210
        # Relpaths on the wire should not be URL-escaped.  So "~" should be
 
211
        # transmitted as "~", not "%7E".
 
212
        transport = RemoteTransport('bzr://localhost/~hello/')
 
213
        client = FakeClient([(('ok', ''), ), (('ok', '', 'no', 'no'), )],
 
214
                            transport.base)
 
215
        bzrdir = RemoteBzrDir(transport, _client=client)
 
216
        result = bzrdir.open_branch()
 
217
        self.assertEqual(
 
218
            [('call', 'BzrDir.open_branch', ('~hello/',)),
 
219
             ('call', 'BzrDir.find_repository', ('~hello/',))],
 
220
            client._calls)
 
221
 
197
222
    def check_open_repository(self, rich_root, subtrees):
198
223
        transport = MemoryTransport()
199
224
        transport.mkdir('quack')