~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: jml at canonical
  • Date: 2007-03-28 06:52:02 UTC
  • mto: (2376.4.14 lp-bugs)
  • mto: This revision was merged to the branch mainline in revision 2446.
  • Revision ID: jml@canonical.com-20070328065202-1r825jxnabsy31ak
Blackbox-driven --fixes option to commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
358
358
        # --no-strict overrides --strict
359
359
        self.run_bzr('commit', '--strict', '-m', 'add b', '--no-strict',
360
360
                     working_dir='tree')
 
361
 
 
362
    def test_fixes_bug_output(self):
 
363
        """commit --fixes=lp:23452 succeeds without output."""
 
364
        self.runbzr("init")
 
365
        self.build_tree(['hello.txt'])
 
366
        self.runbzr('add hello.txt')
 
367
        output = self.capture('commit -m hello --fixes=lp:23452 hello.txt')
 
368
        self.assertEqual('', output)
 
369
 
 
370
    def test_fixes_bug_sets_property(self):
 
371
        """commit --fixes=lp:23452 sets the lp:23452 revprop to 'fixed'."""
 
372
        tree = self.make_branch_and_tree('tree')
 
373
        self.build_tree(['tree/hello.txt'])
 
374
        tree.add('hello.txt')
 
375
        self.runbzr('commit -m hello --fixes=lp:23452 tree/hello.txt')
 
376
 
 
377
        # Get the revision properties, ignoring the branch-nick property, which
 
378
        # we don't care about for this test.
 
379
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
380
        properties = dict(last_rev.properties)
 
381
        del properties['branch-nick']
 
382
 
 
383
        self.assertEqual({'lp:23452': 'fixed'}, properties)
 
384
 
 
385
    def test_fixes_multiple_bugs_sets_properties(self):
 
386
        """--fixes can be used more than once to show that bugs are fixed."""
 
387
        tree = self.make_branch_and_tree('tree')
 
388
        self.build_tree(['tree/hello.txt'])
 
389
        tree.add('hello.txt')
 
390
        self.runbzr(
 
391
            'commit -m hello --fixes=lp:123 --fixes=lp:235 tree/hello.txt')
 
392
 
 
393
        # Get the revision properties, ignoring the branch-nick property, which
 
394
        # we don't care about for this test.
 
395
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
396
        properties = dict(last_rev.properties)
 
397
        del properties['branch-nick']
 
398
 
 
399
        self.assertEqual({'lp:123': 'fixed', 'lp:235': 'fixed'}, properties)