~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_request.py

  • Committer: Martin Pool
  • Date: 2010-02-25 06:17:27 UTC
  • mfrom: (5055 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5057.
  • Revision ID: mbp@sourcefrog.net-20100225061727-4sd9lt0qmdc6087t
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
            ('NoSuchFile', 'path'), errors.NoSuchFile('path'))
160
160
 
161
161
    def test_LockContention(self):
 
162
        # For now, LockContentions are always transmitted with no details.
 
163
        # Eventually they should include a relpath or url or something else to
 
164
        # identify which lock is busy.
162
165
        self.assertTranslationEqual(
163
 
            ('LockContention', 'lock', 'msg'),
164
 
            errors.LockContention('lock', 'msg'))
 
166
            ('LockContention',), errors.LockContention('lock', 'msg'))
165
167
 
166
168
    def test_TokenMismatch(self):
167
169
        self.assertTranslationEqual(
199
201
        # A child of a transport in jail_info is allowed
200
202
        _pre_open_hook(t.clone('child'))
201
203
        # A parent is not allowed
202
 
        self.assertRaises(errors.BzrError, _pre_open_hook, t.clone('..'))
 
204
        self.assertRaises(errors.JailBreak, _pre_open_hook, t.clone('..'))
203
205
        # A completely unrelated transport is not allowed
204
206
        self.assertRaises(
205
 
            errors.BzrError, _pre_open_hook, get_transport('http://host/'))
 
207
            errors.JailBreak, _pre_open_hook, get_transport('http://host/'))
206
208
 
207
209
    def test_open_bzrdir_in_non_main_thread(self):
208
210
        """Opening a bzrdir in a non-main thread should work ok.