~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(gz) Remove bzrlib/util/elementtree/ package (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for display of exceptions."""
18
18
 
19
19
import os
20
 
import sys
 
20
import re
21
21
 
22
22
from bzrlib import (
23
23
    bzrdir,
30
30
    )
31
31
from bzrlib.repofmt.groupcompress_repo import RepositoryFormat2a
32
32
 
33
 
from bzrlib.tests import TestCase
34
 
 
35
 
 
36
 
class TestExceptionReporting(TestCase):
 
33
 
 
34
class TestExceptionReporting(tests.TestCaseInTempDir):
37
35
 
38
36
    def test_exception_exitcode(self):
39
37
        # we must use a subprocess, because the normal in-memory mechanism
58
56
            env_changes={"LANG": "C", "LC_ALL": "C"},
59
57
            universal_newlines=True,
60
58
            retcode=errors.EXIT_ERROR)
61
 
        self.assertContainsRe(err, r"^bzr: ERROR: .*'\\xa0'.* unsupported")
 
59
        self.assertContainsRe(err, r"^bzr: ERROR: .*'\\xa0'.* unsupported",
 
60
            flags=re.MULTILINE)
62
61
        self.assertEquals(out, "")
63
62
 
64
 
 
65
 
class TestOptParseBugHandling(TestCase):
 
63
    def test_utf8_default_fs_enc(self):
 
64
        """In the C locale bzr treats a posix filesystem as UTF-8 encoded"""
 
65
        if os.name != "posix":
 
66
            raise tests.TestNotApplicable("Needs system beholden to C locales")
 
67
        out, err = self.run_bzr_subprocess(["init", "file:%C2%A7"],
 
68
            env_changes={"LANG": "C", "LC_ALL": "C"})
 
69
        self.assertContainsRe(out, "^Created a standalone tree .*$")
 
70
 
 
71
 
 
72
class TestOptParseBugHandling(tests.TestCase):
66
73
    "Test that we handle http://bugs.python.org/issue2931"
67
74
 
68
75
    def test_nonascii_optparse(self):