~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jonathan Riddell
  • Date: 2011-09-07 14:20:10 UTC
  • mfrom: (6123.1.10 +trunk)
  • mto: (6123.1.12 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6124.
  • Revision ID: jriddell@canonical.com-20110907142010-kncwzcbpsxd714ug
mergeĀ inĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
596
596
            'commit -m add-b --fixes=xxx:123',
597
597
            working_dir='tree')
598
598
 
 
599
    def test_fixes_bug_with_default_tracker(self):
 
600
        """commit --fixes=234 uses the default bug tracker."""
 
601
        tree = self.make_branch_and_tree('tree')
 
602
        self.build_tree(['tree/hello.txt'])
 
603
        tree.add('hello.txt')
 
604
        self.run_bzr_error(
 
605
            ["bzr: ERROR: No tracker specified for bug 123. Use the form "
 
606
            "'tracker:id' or specify a default bug tracker using the "
 
607
            "`bugtracker` option.\n"
 
608
            "See \"bzr help bugs\" for more information on this feature. "
 
609
            "Commit refused."],
 
610
            'commit -m add-b --fixes=123',
 
611
            working_dir='tree')
 
612
        tree.branch.get_config().set_user_option("bugtracker", "lp")
 
613
        self.run_bzr('commit -m hello --fixes=234 tree/hello.txt')
 
614
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
615
        self.assertEqual('https://launchpad.net/bugs/234 fixed',
 
616
                         last_rev.properties['bugs'])
 
617
 
599
618
    def test_fixes_invalid_bug_number(self):
600
619
        tree = self.make_branch_and_tree('tree')
601
620
        self.build_tree(['tree/hello.txt'])
613
632
        self.build_tree(['tree/hello.txt'])
614
633
        tree.add('hello.txt')
615
634
        self.run_bzr_error(
616
 
            [r"Invalid bug orange. Must be in the form of 'tracker:id'\. "
617
 
             r"See \"bzr help bugs\" for more information on this feature.\n"
618
 
             r"Commit refused\."],
619
 
            'commit -m add-b --fixes=orange',
 
635
            [r"Invalid bug orange:apples:bananas. Must be in the form of "
 
636
             r"'tracker:id'\. See \"bzr help bugs\" for more information on "
 
637
             r"this feature.\nCommit refused\."],
 
638
            'commit -m add-b --fixes=orange:apples:bananas',
620
639
            working_dir='tree')
621
640
 
622
641
    def test_no_author(self):