/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_request.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Tests for smart server request infrastructure (breezy.bzr.smart.request)."""
 
17
"""Tests for smart server request infrastructure (bzrlib.smart.request)."""
18
18
 
19
19
import threading
20
20
 
21
 
from breezy import (
 
21
from bzrlib import (
22
22
    errors,
23
23
    transport,
24
24
    )
25
 
from breezy.bzr.bzrdir import BzrDir
26
 
from breezy.bzr.smart import request
27
 
from breezy.tests import TestCase, TestCaseWithMemoryTransport
 
25
from bzrlib.bzrdir import BzrDir
 
26
from bzrlib.smart import request
 
27
from bzrlib.tests import TestCase, TestCaseWithMemoryTransport
28
28
 
29
29
 
30
30
class NoBodyRequest(request.SmartServerRequest):
90
90
        self.jail_transports_log.append(request.jail_info.transports)
91
91
 
92
92
 
93
 
class TestErrors(TestCase):
94
 
 
95
 
    def test_disabled_method(self):
96
 
        error = request.DisabledMethod("class name")
97
 
        self.assertEqualDiff(
98
 
            "The smart server method 'class name' is disabled.", str(error))
99
 
 
100
 
 
101
93
class TestSmartRequest(TestCase):
102
94
 
103
95
    def test_request_class_without_do_body(self):
184
176
 
185
177
 
186
178
class TestRequestHanderErrorTranslation(TestCase):
187
 
    """Tests for breezy.bzr.smart.request._translate_error."""
 
179
    """Tests for bzrlib.smart.request._translate_error."""
188
180
 
189
181
    def assertTranslationEqual(self, expected_tuple, error):
190
182
        self.assertEqual(expected_tuple, request._translate_error(error))
264
256
        """Opening a bzrdir in a non-main thread should work ok.
265
257
        
266
258
        This makes sure that the globally-installed
267
 
        breezy.bzr.smart.request._pre_open_hook, which uses a threading.local(),
 
259
        bzrlib.smart.request._pre_open_hook, which uses a threading.local(),
268
260
        works in a newly created thread.
269
261
        """
270
 
        bzrdir = self.make_controldir('.')
 
262
        bzrdir = self.make_bzrdir('.')
271
263
        transport = bzrdir.root_transport
272
264
        thread_result = []
273
265
        def t():