~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: 2009-03-06 06:48:25 UTC
  • mfrom: (4070.8.6 debug-config)
  • Revision ID: pqm@pqm.ubuntu.com-20090306064825-kbpwggw21dygeix6
(mbp) debug_flags configuration option

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
 
18
18
"""Tests for the commit CLI of bzr."""
124
124
        wt.rename_one('hello.txt', 'subdir/hello.txt')
125
125
        out, err = self.run_bzr('commit -m renamed')
126
126
        self.assertEqual('', out)
127
 
        self.assertEqual(set([
128
 
            'Committing to: %s/' % osutils.getcwd(),
129
 
            'added subdir',
130
 
            'renamed hello.txt => subdir/hello.txt',
131
 
            'Committed revision 2.',
132
 
            '',
133
 
            ]), set(err.split('\n')))
 
127
        self.assertContainsRe(err, '^Committing to: .*\n'
 
128
                              'added subdir\n'
 
129
                              'renamed hello\.txt => subdir/hello\.txt\n'
 
130
                              'Committed revision 2\.\n$')
134
131
 
135
132
    def test_verbose_commit_with_unknown(self):
136
133
        """Unknown files should not be listed by default in verbose output"""
223
220
        os.chdir('this')
224
221
        out,err = self.run_bzr('commit -m added')
225
222
        self.assertEqual('', out)
226
 
        self.assertEqual(set([
227
 
            'Committing to: %s/' % osutils.getcwd(),
228
 
            'modified filetomodify',
229
 
            'added newdir',
230
 
            'added newfile',
231
 
            'renamed dirtorename => renameddir',
232
 
            'renamed filetorename => renamedfile',
233
 
            'renamed dirtoreparent => renameddir/reparenteddir',
234
 
            'renamed filetoreparent => renameddir/reparentedfile',
235
 
            'deleted dirtoremove',
236
 
            'deleted filetoremove',
237
 
            'Committed revision 2.',
238
 
            ''
239
 
            ]), set(err.split('\n')))
 
223
        expected = '%s/' % (osutils.getcwd(), )
 
224
        self.assertEqualDiff(
 
225
            'Committing to: %s\n'
 
226
            'modified filetomodify\n'
 
227
            'added newdir\n'
 
228
            'added newfile\n'
 
229
            'renamed dirtorename => renameddir\n'
 
230
            'renamed filetorename => renamedfile\n'
 
231
            'renamed dirtoreparent => renameddir/reparenteddir\n'
 
232
            'renamed filetoreparent => renameddir/reparentedfile\n'
 
233
            'deleted dirtoremove\n'
 
234
            'deleted filetoremove\n'
 
235
            'Committed revision 2.\n' % (expected, ),
 
236
            err)
240
237
 
241
238
    def test_empty_commit_message(self):
242
239
        tree = self.make_branch_and_tree('.')
520
517
        self.build_tree(['tree/hello.txt'])
521
518
        tree.add('hello.txt')
522
519
        self.run_bzr_error(
523
 
            ["Did not understand bug identifier orange: Must be an integer. "
524
 
             "See \"bzr help bugs\" for more information on this feature.\n"
525
 
             "Commit refused."],
 
520
            ["Invalid bug identifier for %s. Commit refused." % 'lp:orange'],
526
521
            'commit -m add-b --fixes=lp:orange',
527
522
            working_dir='tree')
528
523
 
532
527
        self.build_tree(['tree/hello.txt'])
533
528
        tree.add('hello.txt')
534
529
        self.run_bzr_error(
535
 
            [r"Invalid bug orange. Must be in the form of 'tracker:id'\. "
536
 
             r"See \"bzr help bugs\" for more information on this feature.\n"
 
530
            [r"Invalid bug orange. Must be in the form of 'tag:id'\. "
537
531
             r"Commit refused\."],
538
532
            'commit -m add-b --fixes=orange',
539
533
            working_dir='tree')