~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2011-04-18 23:21:01 UTC
  • mfrom: (5799 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5800.
  • Revision ID: jelmer@samba.org-20110418232101-utgj6599ow9ny9nh
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
335
335
        tree.add('foo.c')
336
336
        self.run_bzr('commit -m ""', retcode=3)
337
337
 
338
 
    def test_unsupported_encoding_commit_message(self):
339
 
        if sys.platform == 'win32':
340
 
            raise tests.TestNotApplicable('Win32 parses arguments directly'
341
 
                ' as Unicode, so we can\'t pass invalid non-ascii')
342
 
        tree = self.make_branch_and_tree('.')
343
 
        self.build_tree_contents([('foo.c', 'int main() {}')])
344
 
        tree.add('foo.c')
345
 
        # LANG env variable has no effect on Windows
346
 
        # but some characters anyway cannot be represented
347
 
        # in default user encoding
348
 
        char = probe_bad_non_ascii(osutils.get_user_encoding())
349
 
        if char is None:
350
 
            raise TestSkipped('Cannot find suitable non-ascii character'
351
 
                'for user_encoding (%s)' % osutils.get_user_encoding())
352
 
        out,err = self.run_bzr_subprocess('commit -m "%s"' % char,
353
 
                                          retcode=1,
354
 
                                          env_changes={'LANG': 'C'})
355
 
        self.assertContainsRe(err, r'bzrlib.errors.BzrError: Parameter.*is '
356
 
                                    'unsupported by the current encoding.')
357
 
 
358
338
    def test_other_branch_commit(self):
359
339
        # this branch is to ensure consistent behaviour, whether we're run
360
340
        # inside a branch, or not.