~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-09 17:04:46 UTC
  • mfrom: (6055.1.3 822571-bzr-home-unicode)
  • Revision ID: pqm@pqm.ubuntu.com-20110809170446-f1wc1a8fhgnxi4cn
(vila) Decode BZR_HOME with fs encoding to allow unicode homes. (Vincent
 Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    probe_bad_non_ascii,
37
37
    test_foreign,
38
38
    TestSkipped,
39
 
    UnicodeFilenameFeature,
 
39
    features,
40
40
    )
41
41
from bzrlib.tests import TestCaseWithTransport
42
42
 
138
138
    def test_unicode_commit_message_is_filename(self):
139
139
        """Unicode commit message same as a filename (Bug #563646).
140
140
        """
141
 
        self.requireFeature(UnicodeFilenameFeature)
 
141
        self.requireFeature(features.UnicodeFilenameFeature)
142
142
        file_name = u'\N{euro sign}'
143
143
        self.run_bzr(['init'])
144
144
        open(file_name, 'w').write('hello world')
754
754
            "commit tree/hello.txt", stdin="n\n")
755
755
        self.assertEqual(expected, tree.last_revision())
756
756
 
 
757
    def test_set_commit_message(self):
 
758
        msgeditor.hooks.install_named_hook("set_commit_message",
 
759
                lambda commit_obj, msg: "save me some typing\n", None)
 
760
        tree = self.make_branch_and_tree('tree')
 
761
        self.build_tree(['tree/hello.txt'])
 
762
        tree.add('hello.txt')
 
763
        out, err = self.run_bzr("commit tree/hello.txt")
 
764
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
765
        self.assertEqual('save me some typing\n', last_rev.message)
 
766
 
757
767
    def test_commit_without_username(self):
758
768
        """Ensure commit error if username is not set.
759
769
        """
782
792
        self.assertEqual(out, '')
783
793
        self.assertContainsRe(err,
784
794
            'Branch.*test_checkout.*appears to be bound to itself')
785