~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-17 07:59:42 UTC
  • mto: This revision was merged to the branch mainline in revision 2446.
  • Revision ID: jml@canonical.com-20070417075942-1vfzpwjf8rvbty1f
Variety of whitespace cleanups, tightening of tests and docstring changes in
response to review of bug support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib.tests import TestCaseWithMemoryTransport
21
21
 
22
22
 
23
 
 
24
23
class TestGetBugURL(TestCaseWithMemoryTransport):
25
24
    """Tests for bugtracker.get_bug_url"""
26
25
 
59
58
        tracker = bugtracker.UniqueBugTracker()
60
59
        tracker.base_url = 'http://bugs.com'
61
60
        self.assertEqual('http://bugs.com/1234', tracker.get_bug_url('1234'))
 
61
        self.assertEqual('http://bugs.com/red', tracker.get_bug_url('red'))
62
62
 
63
63
    def test_returns_tracker_if_tag_matches(self):
64
64
        """The get() classmethod should return an instance of the tracker if
73
73
        self.assertEqual('xxx', tracker.tag)
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.
 
79
        """
 
80
        class SomeTracker(bugtracker.UniqueBugTracker):
 
81
            tag = 'xxx'
 
82
            base_url = 'http://bugs.com'
 
83
 
 
84
        branch = self.make_branch('some_branch')
 
85
        tracker = SomeTracker.get('xxx', branch)
 
86
        self.assertEqual(None, SomeTracker.get('yyy', branch))
 
87
 
76
88
 
77
89
class TestUniqueIntegerBugTracker(TestCaseWithMemoryTransport):
78
90
 
148
160
 
149
161
 
150
162
class TestTracTracker(TestCaseWithMemoryTransport):
 
163
    """Tests for TracTracker."""
 
164
 
151
165
    def setUp(self):
152
166
        TestCaseWithMemoryTransport.setUp(self)
153
167
        self.trac_url = 'http://twistedmatrix.com/trac'