/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 breezy/tests/blackbox/test_non_ascii.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 19:09:26 UTC
  • mfrom: (6622.1.36 breezy)
  • Revision ID: jelmer@jelmer.uk-20170521190926-5vtz8xaf0e9ylrpc
Merge rename to breezy.

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
 
"""Black-box tests for bzr handling non-ascii characters."""
 
17
"""Black-box tests for brz handling non-ascii characters."""
18
18
 
19
19
import os
20
20
import sys
21
21
 
22
 
from bzrlib import (
 
22
from breezy import (
23
23
    osutils,
24
24
    tests,
25
25
    urlutils,
26
26
    )
27
 
from bzrlib.tests import EncodingAdapter
28
 
from bzrlib.tests.scenarios import load_tests_apply_scenarios
 
27
from breezy.tests import EncodingAdapter
 
28
from breezy.tests.scenarios import load_tests_apply_scenarios
29
29
 
30
30
 
31
31
load_tests = load_tests_apply_scenarios
32
32
 
33
33
 
34
34
class TestNonAscii(tests.TestCaseWithTransport):
35
 
    """Test that bzr handles files/committers/etc which are non-ascii."""
 
35
    """Test that brz handles files/committers/etc which are non-ascii."""
36
36
 
37
37
    scenarios = EncodingAdapter.encoding_scenarios
38
38
 
42
42
 
43
43
        self.overrideAttr(osutils, '_cached_user_encoding', self.encoding)
44
44
        email = self.info['committer'] + ' <joe@foo.com>'
45
 
        self.overrideEnv('BZR_EMAIL', email.encode(osutils.get_user_encoding()))
 
45
        self.overrideEnv('BRZ_EMAIL', email.encode(osutils.get_user_encoding()))
46
46
        self.create_base()
47
47
 
48
48
    def run_bzr_decode(self, args, encoding=None, fail=False, retcode=None,
49
49
                       working_dir=None):
50
 
        """Run bzr and decode the output into a particular encoding.
 
50
        """Run brz and decode the output into a particular encoding.
51
51
 
52
52
        Returns a string containing the stdout output from bzr.
53
53
 
149
149
        self.assertEqual(expected, txt)
150
150
 
151
151
    def test_cat(self):
152
 
        # bzr cat shouldn't change the contents
153
 
        # using run_bzr since that doesn't decode
 
152
        # brz cat shouldn't change the contents
 
153
        # using run_brz since that doesn't decode
154
154
        txt = self.run_bzr('cat b')[0]
155
155
        self.assertEqual('non-ascii \xFF\xFF\xFC\xFB\x00 in b\n', txt)
156
156
 
477
477
        fname = self.info['filename'] + '2'
478
478
        self.build_tree_contents([(fname, 'unknown\n')])
479
479
 
480
 
        # TODO: jam 20060112 bzr unknowns is the only one which
 
480
        # TODO: jam 20060112 brz unknowns is the only one which
481
481
        #       quotes paths do we really want it to?
482
482
        #       awilkins 20080521 added and modified do it now as well
483
483
        txt = self.run_bzr_decode('unknowns')