~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-11 11:47:36 UTC
  • mfrom: (5200.3.8 lock_return)
  • Revision ID: pqm@pqm.ubuntu.com-20100511114736-mc1sq9zyo3vufec7
(lifeless) Provide a consistent interface to Tree, Branch,
 Repository where lock methods return an object with an unlock method to
 unlock the lock. This breaks the API for Branch,
 Repository on their lock_write methods. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2301
2301
        transport_path = 'quack'
2302
2302
        repo, client = self.setup_fake_client_and_repository(transport_path)
2303
2303
        client.add_success_response('ok', 'a token')
2304
 
        result = repo.lock_write()
 
2304
        token = repo.lock_write().repository_token
2305
2305
        self.assertEqual(
2306
2306
            [('call', 'Repository.lock_write', ('quack/', ''))],
2307
2307
            client._calls)
2308
 
        self.assertEqual('a token', result)
 
2308
        self.assertEqual('a token', token)
2309
2309
 
2310
2310
    def test_lock_write_already_locked(self):
2311
2311
        transport_path = 'quack'