14from PRESUBMIT_test_mocks
import MockFile, MockAffectedFile
15from PRESUBMIT_test_mocks
import MockInputApi, MockOutputApi
21 mock_input_api.files = [
27 mock_input_api, mock_output_api)
29 self.assertEqual(0,
len(results))
33 mock_input_api.files = [
39 mock_input_api, mock_output_api)
41 self.assertEqual(1,
len(results))
42 self.assertIsInstance(
43 results[0], mock_output_api.PresubmitPromptWarning,
'Not a warning')
44 self.assertTrue(results[0].message.startswith(
45 'Do not edit RELEASE_NOTES.md'))
49 mock_input_api.files = [
51 MockFile(
'relnotes/deleted_note.md',
''),
56 mock_input_api, mock_output_api)
58 self.assertEqual(0,
len(results))
62 mock_input_api.files = [
63 MockFile(
'include/core/SkDrawable.h',
''),
68 mock_input_api, mock_output_api)
70 self.assertEqual(1,
len(results))
71 self.assertIsInstance(
72 results[0], mock_output_api.PresubmitPromptWarning,
'Not a warning')
76 mock_input_api.files = [
77 MockFile(
'include/core/SkDrawable.h',
''),
78 MockFile(
'relnotes/new_note.md',
''),
83 mock_input_api, mock_output_api)
85 self.assertEqual(0,
len(results))
88if __name__ ==
'__main__':
def testUpdateTopReleaseNotesIssuesWarning(self)
def testUpdatePublicHeaderAndReleaseNoteGeneratesNoWarning(self)
def testUpdateTopReleaseNotesNoWarning(self)
def testNoEditTopReleaseNotesNoWarning(self)
def testUpdatePublicHeaderAndNoReleaseNoteGeneratesWarning(self)
def _CheckReleaseNotesForPublicAPI(input_api, output_api)
def _CheckTopReleaseNotesChanged(input_api, output_api)