/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_msgeditor.py

  • Committer: Robert Collins
  • Date: 2008-02-13 03:30:01 UTC
  • mfrom: (3221 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3224.
  • Revision ID: robertc@robertcollins.net-20080213033001-rw70ul0zb02ph856
Merge to fix conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    edit_commit_message_encoded
34
34
)
35
35
from bzrlib.tests import (
 
36
    iter_suite_tests,
36
37
    probe_bad_non_ascii,
 
38
    split_suite_by_re,
37
39
    TestCaseWithTransport,
 
40
    TestNotApplicable,
38
41
    TestSkipped,
39
42
    )
 
43
from bzrlib.tests.EncodingAdapter import EncodingTestAdapter
40
44
from bzrlib.trace import mutter
41
45
 
42
46
 
 
47
def load_tests(standard_tests, module, loader):
 
48
    """Parameterize the test for tempfile creation with different encodings."""
 
49
    to_adapt, result = split_suite_by_re(standard_tests,
 
50
        "test__create_temp_file_with_commit_template_in_unicode_dir")
 
51
    for test in iter_suite_tests(to_adapt):
 
52
        result.addTests(EncodingTestAdapter().adapt(test))
 
53
    return result
 
54
 
 
55
 
43
56
class MsgEditorTest(TestCaseWithTransport):
44
57
 
45
58
    def make_uncommitted_tree(self):
243
256
                                    'infotext'])
244
257
        self.assertFileEqual(expected, msgfilename)
245
258
 
 
259
    def test__create_temp_file_with_commit_template_in_unicode_dir(self):
 
260
        from bzrlib.tests.test_diff import UnicodeFilename
 
261
        self.requireFeature(UnicodeFilename)
 
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
 
246
269
    def test__create_temp_file_with_empty_commit_template(self):
247
270
        # empty file
248
271
        create_file = msgeditor._create_temp_file_with_commit_template