Example #1
0
 def test_doesnt_consult_branch(self):
     """A UniqueIntegerBugTracker shouldn't consult the branch for tracker
     information.
     """
     tracker = bugtracker.UniqueIntegerBugTracker('xxx', 'http://bugs.com/')
     self.assertIs(tracker, tracker.get('xxx', None))
     self.assertIs(None, tracker.get('yyy', None))
Example #2
0
 def test_returns_none_if_abbreviation_doesnt_match(self):
     """The get() method should return None if the given abbreviated name
     doesn't match the tracker's abbreviation.
     """
     tracker = bugtracker.UniqueIntegerBugTracker('xxx', 'http://bugs.com/')
     branch = self.make_branch('some_branch')
     self.assertIs(None, tracker.get('yyy', branch))
Example #3
0
 def test_returns_tracker_if_abbreviation_matches(self):
     """The get() method should return an instance of the tracker if the
     given abbreviation matches the tracker's abbreviated name.
     """
     tracker = bugtracker.UniqueIntegerBugTracker('xxx', 'http://bugs.com/')
     branch = self.make_branch('some_branch')
     self.assertIs(tracker, tracker.get('xxx', branch))
Example #4
0
 def test_check_bug_id_doesnt_accept_non_integers(self):
     """A UniqueIntegerBugTracker rejects non-integers as bug IDs."""
     tracker = bugtracker.UniqueIntegerBugTracker('xxx', 'http://bugs.com/')
     self.assertRaises(errors.MalformedBugIdentifier, tracker.check_bug_id,
                       'red')
Example #5
0
 def test_check_bug_id_only_accepts_integers(self):
     """A UniqueIntegerBugTracker accepts integers as bug IDs."""
     tracker = bugtracker.UniqueIntegerBugTracker('xxx', 'http://bugs.com/')
     tracker.check_bug_id('1234')
Example #6
0
 def test_appends_id_to_base_url(self):
     """The URL of a bug is the base URL joined to the identifier."""
     tracker = bugtracker.UniqueIntegerBugTracker('xxx',
                                                  'http://bugs.com/foo')
     self.assertEqual('http://bugs.com/foo1234',
                      tracker.get_bug_url('1234'))