~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bugtracker.py

  • Committer: Jonathan Lange
  • Date: 2007-04-20 00:56:27 UTC
  • mto: This revision was merged to the branch mainline in revision 2446.
  • Revision ID: jml@canonical.com-20070420005627-p6rrsxowxkf7w5sy
Change 'tag' to 'abbreviated_tracker_name'

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
        self.assertEqual('%s/ticket/1234' % trac_url,
39
39
                         bugtracker.get_bug_url('twisted', branch, '1234'))
40
40
 
41
 
    def test_unrecognized_tag(self):
42
 
        """If the tag is unrecognized, then raise a KeyError."""
 
41
    def test_unrecognized_abbreviation(self):
 
42
        """If the abbreviation is unrecognized, then raise a KeyError."""
43
43
        branch = self.make_branch('some_branch')
44
44
        self.assertRaises(KeyError,
45
45
                          bugtracker.get_bug_url, 'xxx', branch, '1234')
60
60
        self.assertEqual('http://bugs.com/1234', tracker.get_bug_url('1234'))
61
61
        self.assertEqual('http://bugs.com/red', tracker.get_bug_url('red'))
62
62
 
63
 
    def test_returns_tracker_if_tag_matches(self):
 
63
    def test_returns_tracker_if_abbreviation_matches(self):
64
64
        """The get() classmethod should return an instance of the tracker if
65
 
        the given tag matches the tracker's tag.
 
65
        the given abbreviation matches the tracker's abbreviated name.
66
66
        """
67
67
        class SomeTracker(bugtracker.UniqueBugTracker):
68
 
            tag = 'xxx'
 
68
            abbreviated_bugtracker_name = 'xxx'
69
69
            base_url = 'http://bugs.com'
70
70
 
71
71
        branch = self.make_branch('some_branch')
72
72
        tracker = SomeTracker.get('xxx', branch)
73
 
        self.assertEqual('xxx', tracker.tag)
 
73
        self.assertEqual('xxx', tracker.abbreviated_bugtracker_name)
74
74
        self.assertEqual('http://bugs.com/1234', tracker.get_bug_url('1234'))
75
75
 
76
 
    def test_returns_none_if_tag_doesnt_match(self):
77
 
        """The get() classmethod should return None if the given tag doesn't
78
 
        match the tracker's tag.
 
76
    def test_returns_none_if_abbreviation_doesnt_match(self):
 
77
        """The get() classmethod should return None if the given abbreviated
 
78
        name doesn't match the tracker's abbreviation.
79
79
        """
80
80
        class SomeTracker(bugtracker.UniqueBugTracker):
81
 
            tag = 'xxx'
 
81
            abbreviated_bugtracker_name = 'xxx'
82
82
            base_url = 'http://bugs.com'
83
83
 
84
84
        branch = self.make_branch('some_branch')