Beispiel #1
0
 def testCommitMessageBugEntryIsNone(self):
   mock_input_api = MockInputApi()
   mock_output_api = MockOutputApi()
   mock_input_api.change = MockChange([], ['None'])
   errors = PRESUBMIT.CheckCommitMessageBugEntry(mock_input_api,
                                                 mock_output_api)
   self.assertEqual(0, len(errors))
Beispiel #2
0
 def testCommitMessageBugEntryWithNoError(self):
   mock_input_api = MockInputApi()
   mock_output_api = MockOutputApi()
   mock_input_api.change = MockChange([], ['webrtc:1234'])
   errors = PRESUBMIT.CheckCommitMessageBugEntry(mock_input_api,
                                                 mock_output_api)
   self.assertEqual(0, len(errors))
Beispiel #3
0
 def testCommitMessageBugEntryWithoutPrefix(self):
   mock_input_api = MockInputApi()
   mock_output_api = MockOutputApi()
   mock_input_api.change = MockChange([], ['1234'])
   errors = PRESUBMIT.CheckCommitMessageBugEntry(mock_input_api,
                                                 mock_output_api)
   self.assertEqual(1, len(errors))
   self.assertEqual(('Bug entry requires issue tracker prefix, '
                     'e.g. webrtc:1234'), str(errors[0]))
Beispiel #4
0
 def testCommitMessageBugEntryReturnError(self):
   mock_input_api = MockInputApi()
   mock_output_api = MockOutputApi()
   mock_input_api.change = MockChange([], ['webrtc:1234', 'webrtc=4321'])
   errors = PRESUBMIT.CheckCommitMessageBugEntry(mock_input_api,
                                                 mock_output_api)
   self.assertEqual(1, len(errors))
   self.assertEqual(('Bogus Bug entry: webrtc=4321. Please specify'
                     ' the issue tracker prefix and the issue number,'
                     ' separated by a colon, e.g. webrtc:123 or'
                     ' chromium:12345.'), str(errors[0]))