~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2015-12-17 18:39:00 UTC
  • mfrom: (6606.1.2 fix-float)
  • Revision ID: pqm@pqm.ubuntu.com-20151217183900-0719du2uv1kwu3lc
(vila) Inline testtools private method to fix an issue in xenial (the
 private implementation has changed in an backward incompatible way).
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
            flags=re.MULTILINE)
61
61
        self.assertEquals(out, "")
62
62
 
 
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
 
63
71
 
64
72
class TestOptParseBugHandling(tests.TestCase):
65
73
    "Test that we handle http://bugs.python.org/issue2931"
133
141
 
134
142
    def test_repository_deprecation_warning_suppressed_global(self):
135
143
        """Old formats give a warning"""
136
 
        conf = config.GlobalConfig()
137
 
        conf.set_user_option('suppress_warnings', 'format_deprecation')
 
144
        conf = config.GlobalStack()
 
145
        conf.set('suppress_warnings', 'format_deprecation')
138
146
        self.make_obsolete_repo('foo')
139
147
        self.enable_deprecation_warning()
140
148
        out, err = self.run_bzr('status', working_dir='foo')
143
151
    def test_repository_deprecation_warning_suppressed_locations(self):
144
152
        """Old formats give a warning"""
145
153
        self.make_obsolete_repo('foo')
146
 
        conf = config.LocationConfig(osutils.pathjoin(self.test_dir, 'foo'))
147
 
        conf.set_user_option('suppress_warnings', 'format_deprecation')
 
154
        conf = config.LocationStack(osutils.pathjoin(self.test_dir, 'foo'))
 
155
        conf.set('suppress_warnings', 'format_deprecation')
148
156
        self.enable_deprecation_warning()
149
157
        out, err = self.run_bzr('status', working_dir='foo')
150
158
        self.check_warning(False)
152
160
    def test_repository_deprecation_warning_suppressed_branch(self):
153
161
        """Old formats give a warning"""
154
162
        tree = self.make_obsolete_repo('foo')
155
 
        conf = tree.branch.get_config()
156
 
        conf.set_user_option('suppress_warnings', 'format_deprecation')
 
163
        conf = tree.branch.get_config_stack()
 
164
        conf.set('suppress_warnings', 'format_deprecation')
157
165
        self.enable_deprecation_warning()
158
166
        out, err = self.run_bzr('status', working_dir='foo')
159
167
        self.check_warning(False)