~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_exceptions.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-18 23:21:01 UTC
  • mfrom: (5799 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5800.
  • Revision ID: jelmer@samba.org-20110418232101-utgj6599ow9ny9nh
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for display of exceptions."""
18
18
 
 
19
import os
19
20
import sys
20
21
 
21
22
from bzrlib import (
45
46
                r'exceptions\.AssertionError: always fails\n')
46
47
        self.assertContainsRe(err, r'Bazaar has encountered an internal error')
47
48
 
 
49
    def test_undecodable_argv(self):
 
50
        """A user error must be reported if argv is not in the locale encoding
 
51
 
 
52
        A subprocess with an environment ascii-only setting is used so the test
 
53
        can run without worrying about the locale the test suite is using.
 
54
        """
 
55
        if os.name != "posix":
 
56
            raise tests.TestNotApplicable("Needs system beholden to C locales")
 
57
        out, err = self.run_bzr_subprocess(["\xa0"],
 
58
            env_changes={"LANG": "C"},
 
59
            universal_newlines=True,
 
60
            retcode=errors.EXIT_ERROR)
 
61
        self.assertContainsRe(err, r"^bzr: ERROR: .*'\\xa0'.* unsupported")
 
62
        self.assertEquals(out, "")
 
63
 
48
64
 
49
65
class TestOptParseBugHandling(TestCase):
50
66
    "Test that we handle http://bugs.python.org/issue2931"