~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_msgeditor.py

  • Committer: Martin Pool
  • Date: 2007-10-12 08:00:07 UTC
  • mto: This revision was merged to the branch mainline in revision 2913.
  • Revision ID: mbp@sourcefrog.net-20071012080007-vf80woayyom8s8e1
Rename update_to_one_parent_via_delta to more wieldy update_basis_by_delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    errors,
26
26
    msgeditor,
27
27
    osutils,
28
 
    tests,
29
28
    )
30
29
from bzrlib.branch import Branch
31
30
from bzrlib.config import ensure_config_dir_exists, config_filename
34
33
    edit_commit_message_encoded
35
34
)
36
35
from bzrlib.tests import (
37
 
    iter_suite_tests,
38
36
    probe_bad_non_ascii,
39
 
    split_suite_by_re,
40
37
    TestCaseWithTransport,
41
 
    TestNotApplicable,
42
38
    TestSkipped,
43
39
    )
44
 
from bzrlib.tests.EncodingAdapter import EncodingTestAdapter
45
40
from bzrlib.trace import mutter
46
41
 
47
42
 
48
 
def load_tests(standard_tests, module, loader):
49
 
    """Parameterize the test for tempfile creation with different encodings."""
50
 
    to_adapt, result = split_suite_by_re(standard_tests,
51
 
        "test__create_temp_file_with_commit_template_in_unicode_dir")
52
 
    for test in iter_suite_tests(to_adapt):
53
 
        result.addTests(EncodingTestAdapter().adapt(test))
54
 
    return result
55
 
 
56
 
 
57
43
class MsgEditorTest(TestCaseWithTransport):
58
44
 
59
45
    def make_uncommitted_tree(self):
257
243
                                    'infotext'])
258
244
        self.assertFileEqual(expected, msgfilename)
259
245
 
260
 
    def test__create_temp_file_with_commit_template_in_unicode_dir(self):
261
 
        self.requireFeature(tests.UnicodeFilenameFeature)
262
 
        if hasattr(self, 'info'):
263
 
            os.mkdir(self.info['directory'])
264
 
            os.chdir(self.info['directory'])
265
 
            msgeditor._create_temp_file_with_commit_template('infotext')
266
 
        else:
267
 
            raise TestNotApplicable('Test run elsewhere with non-ascii data.')
268
 
 
269
246
    def test__create_temp_file_with_empty_commit_template(self):
270
247
        # empty file
271
248
        create_file = msgeditor._create_temp_file_with_commit_template