~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_request.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-17 18:13:57 UTC
  • mfrom: (5268.7.29 transport-segments)
  • Revision ID: pqm@pqm.ubuntu.com-20110817181357-y5q5eth1hk8bl3om
(jelmer) Allow specifying the colocated branch to use in the branch URL,
 and retrieving the branch name using ControlDir._get_selected_branch.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
        self.assertEqual(
119
119
            [[transport]] * 3, handler._command.jail_transports_log)
120
120
 
121
 
    def test_all_registered_requests_are_safety_qualified(self):
122
 
        unclassified_requests = []
123
 
        allowed_info = ('read', 'idem', 'mutate', 'semivfs', 'semi', 'stream')
124
 
        for key in request.request_handlers.keys():
125
 
            info = request.request_handlers.get_info(key)
126
 
            if info is None or info not in allowed_info:
127
 
                unclassified_requests.append(key)
128
 
        if unclassified_requests:
129
 
            self.fail('These requests were not categorized as safe/unsafe'
130
 
                      ' to retry: %s'  % (unclassified_requests,))
131
121
 
132
122
 
133
123
class TestSmartRequestHandlerErrorTranslation(TestCase):
250
240
        self.assertRaises(errors.JailBreak, _pre_open_hook, t.clone('..'))
251
241
        # A completely unrelated transport is not allowed
252
242
        self.assertRaises(errors.JailBreak, _pre_open_hook,
253
 
                          transport.get_transport_from_url('http://host/'))
 
243
                          transport.get_transport('http://host/'))
254
244
 
255
245
    def test_open_bzrdir_in_non_main_thread(self):
256
246
        """Opening a bzrdir in a non-main thread should work ok.