~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-11-21 16:02:13 UTC
  • mto: This revision was merged to the branch mainline in revision 6285.
  • Revision ID: jelmer@samba.org-20111121160213-w3w6jkfps6s091gq
Allow lazy_regex.lazy_compile patterns to be pickled.

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