~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_msgeditor.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-30 18:28:17 UTC
  • mfrom: (5967.10.2 test-cat)
  • Revision ID: pqm@pqm.ubuntu.com-20110630182817-83a5q9r9rxfkdn8r
(mbp) don't use subprocesses for testing cat (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    errors,
27
27
    msgeditor,
28
28
    osutils,
 
29
    tests,
29
30
    trace,
30
31
    )
31
32
from bzrlib.msgeditor import (
33
34
    edit_commit_message_encoded
34
35
)
35
36
from bzrlib.tests import (
36
 
    features,
37
37
    TestCaseInTempDir,
38
38
    TestCaseWithTransport,
39
39
    TestNotApplicable,
80
80
""")
81
81
 
82
82
    def make_multiple_pending_tree(self):
83
 
        config.GlobalStack().set('email', 'Bilbo Baggins <bb@hobbit.net>')
 
83
        from bzrlib import config
 
84
        config.GlobalConfig().set_user_option('email',
 
85
                                              'Bilbo Baggins <bb@hobbit.net>')
84
86
        tree = self.make_branch_and_tree('a')
85
87
        tree.commit('Initial checkin.', timestamp=1230912900, timezone=0)
86
88
        tree2 = tree.bzrdir.clone('b').open_workingtree()
249
251
        self.overrideEnv('VISUAL', 'visual')
250
252
        self.overrideEnv('EDITOR', 'editor')
251
253
 
252
 
        conf = config.GlobalStack()
253
 
        conf.store._load_from_string('[DEFAULT]\neditor = config_editor\n')
254
 
        conf.store.save()
 
254
        conf = config.GlobalConfig.from_string('editor = config_editor\n',
 
255
                                               save=True)
 
256
 
255
257
        editors = list(msgeditor._get_editor())
256
258
        editors = [editor for (editor, cfg_src) in editors]
257
259
 
307
309
        self.assertFileEqual(expected, msgfilename)
308
310
 
309
311
    def test__create_temp_file_with_commit_template_in_unicode_dir(self):
310
 
        self.requireFeature(features.UnicodeFilenameFeature)
 
312
        self.requireFeature(tests.UnicodeFilenameFeature)
311
313
        if hasattr(self, 'info'):
312
314
            tmpdir = self.info['directory']
313
315
            os.mkdir(tmpdir)