~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Vincent Ladeuil
  • Date: 2010-05-14 14:29:28 UTC
  • mto: (5234.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5235.
  • Revision ID: v.ladeuil+lp@free.fr-20100514142928-nlj2iw6oeszg9gpi
Fixed as per jam's review :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
609
609
        # _get_tree_branch is a form of open_branch, but it should only ask for
610
610
        # branch opening, not any other network requests.
611
611
        calls = []
612
 
        def open_branch():
 
612
        def open_branch(name=None):
613
613
            calls.append("Called")
614
614
            return "a-branch"
615
615
        transport = MemoryTransport()
2257
2257
        self.setup_smart_server_with_call_log()
2258
2258
        tree = self.make_branch_and_memory_tree('.')
2259
2259
        tree.lock_write()
 
2260
        tree.add('')
2260
2261
        rev1 = tree.commit('First')
2261
2262
        rev2 = tree.commit('Second')
2262
2263
        tree.unlock()
2301
2302
        transport_path = 'quack'
2302
2303
        repo, client = self.setup_fake_client_and_repository(transport_path)
2303
2304
        client.add_success_response('ok', 'a token')
2304
 
        result = repo.lock_write()
 
2305
        token = repo.lock_write().repository_token
2305
2306
        self.assertEqual(
2306
2307
            [('call', 'Repository.lock_write', ('quack/', ''))],
2307
2308
            client._calls)
2308
 
        self.assertEqual('a token', result)
 
2309
        self.assertEqual('a token', token)
2309
2310
 
2310
2311
    def test_lock_write_already_locked(self):
2311
2312
        transport_path = 'quack'