Rev 5768: We missed a test case that was asserting the old string. in

John Arbash Meinel john at
Thu Apr 7 13:08:53 UTC 2011


revno: 5768
revision-id: john at
parent: john at
committer: John Arbash Meinel <john at>
branch nick: integration
timestamp: Thu 2011-04-07 15:08:39 +0200
  We missed a test case that was asserting the old string.
  Switch it to using a DocTestMatches matcher, and test the whole content.
  Ideally when we get rid of 'abort commit write group' it won't regress
  in the future.
-------------- next part --------------
=== modified file 'bzrlib/tests/blackbox/'
--- a/bzrlib/tests/blackbox/	2011-04-06 04:18:06 +0000
+++ b/bzrlib/tests/blackbox/	2011-04-07 13:08:39 +0000
@@ -17,17 +17,18 @@
 """Tests for the commit CLI of bzr."""
+import doctest
 import os
 import re
 import sys
+from testtools.matchers import DocTestMatches
 from bzrlib import (
-    bzrdir,
-    osutils,
 from bzrlib.bzrdir import BzrDir
@@ -48,8 +49,18 @@
         out,err = self.run_bzr('commit -m empty', retcode=3)
         self.assertEqual('', out)
-        self.assertContainsRe(err, 'bzr: ERROR: No changes to commit\.'
-                                  ' Use --unchanged to commit anyhow.\n')
+        # Two ugly bits here.
+        # 1) We really don't want 'aborting commit write group' anymore.
+        # 2) bzr: ERROR: is a really long line, so we wrap it with '\'
+        self.assertThat(
+            err,
+            DocTestMatches("""\
+Committing to: ...
+aborting commit write group: PointlessCommit(No changes to commit)
+bzr: ERROR: No changes to commit.\
+ Please 'bzr add' the files you want to commit,\
+ or use --unchanged to force an empty commit.
+""", flags=doctest.ELLIPSIS|doctest.REPORT_UDIFF))
     def test_commit_success(self):
         """Successful commit should not leave behind a bzr-commit-* file"""

More information about the bazaar-commits mailing list