Rev 5768: We missed a test case that was asserting the old string. in http://bazaar.launchpad.net/~jameinel/bzr/integration

John Arbash Meinel john at arbash-meinel.com
Thu Apr 7 13:08:53 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/integration

------------------------------------------------------------
revno: 5768
revision-id: john at arbash-meinel.com-20110407130839-k2m8skey04znbbxd
parent: john at arbash-meinel.com-20110407112514-dpibd0q8wcrrhir5
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: integration
timestamp: Thu 2011-04-07 15:08:39 +0200
message:
  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/test_commit.py'
--- a/bzrlib/tests/blackbox/test_commit.py	2011-04-06 04:18:06 +0000
+++ b/bzrlib/tests/blackbox/test_commit.py	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,
     config,
     osutils,
     ignores,
     msgeditor,
-    osutils,
     tests,
     )
 from bzrlib.bzrdir import BzrDir
@@ -48,8 +49,18 @@
         self.build_tree(['hello.txt'])
         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