~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_transport.py

  • Committer: Andrew Bennetts
  • Date: 2006-09-15 06:30:39 UTC
  • mto: (1752.2.84 remote bzrdir)
  • mto: This revision was merged to the branch mainline in revision 2015.
  • Revision ID: andrew.bennetts@canonical.com-20060915063039-a0488e9077438ecb
Address various review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
        self.backing_transport.mkdir('toffee')
198
198
        self.backing_transport.mkdir('toffee/apple')
199
199
        self.assertEquals('/toffee', transport._remote_path('toffee'))
 
200
        toffee_trans = transport.clone('toffee')
 
201
        # Check that each transport has only the contents of its directory
 
202
        # directly visible. If state was being held in the wrong object, it's
 
203
        # conceivable that cloning a transport would alter the state of the
 
204
        # cloned-from transport.
200
205
        self.assertTrue(transport.has('toffee'))
201
 
        sub_conn = transport.clone('toffee')
202
 
        self.assertTrue(sub_conn.has('apple'))
 
206
        self.assertFalse(toffee_trans.has('toffee'))
 
207
        self.assertFalse(transport.has('apple'))
 
208
        self.assertTrue(toffee_trans.has('apple'))
203
209
 
204
210
    def test_open_bzrdir(self):
205
211
        """Open an existing bzrdir over smart transport"""
221
227
    def test_get_bundle(self):
222
228
        from bzrlib.bundle import serializer
223
229
        wt = self.make_branch_and_tree('.')
224
 
        b = wt.branch
225
 
        file('hello', 'w').write('hello world')
 
230
        self.build_tree_contents([('hello', 'hello world')])
226
231
        wt.add('hello')
227
 
        wt.commit(message='add hello', rev_id='rev-1')
 
232
        rev_id = wt.commit('add hello')
228
233
        
229
234
        server = smart.SmartServer(self.get_transport())
230
 
        response = server.dispatch_command('get_bundle', ('.', 'rev-1'))
231
 
        self.assert_(response.body.startswith('# Bazaar revision bundle '),
232
 
                     "doesn't look like a bundle: %r" % response.body)
 
235
        response = server.dispatch_command('get_bundle', ('.', rev_id))
233
236
        bundle = serializer.read_bundle(StringIO(response.body))
234
237
 
235
238