summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT_test.py
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 18:31:42 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 18:31:42 +0000
commitf7051d55dcf87af1d7dc2df7b26f624fa35950b8 (patch)
tree335083a76bd915542376bddf2b60ba6ace989c47 /PRESUBMIT_test.py
parent268fefa3012e4400267d3ba3b68374c0a7fd024c (diff)
downloadchromium_src-f7051d55dcf87af1d7dc2df7b26f624fa35950b8.zip
chromium_src-f7051d55dcf87af1d7dc2df7b26f624fa35950b8.tar.gz
chromium_src-f7051d55dcf87af1d7dc2df7b26f624fa35950b8.tar.bz2
Update PRESUBMIT scripts to use PresubmitPromptOrNotify helper.
NOTRY=true Review URL: https://chromiumcodereview.appspot.com/13093006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT_test.py')
-rwxr-xr-xPRESUBMIT_test.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index 8c4b3ff..ed7e190 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -43,6 +43,11 @@ class MockOutputApi(object):
MockOutputApi.PresubmitResult.__init__(self, message, items, long_text)
self.type = 'notify'
+ class PresubmitPromptOrNotify(PresubmitResult):
+ def __init__(self, message, items, long_text=''):
+ MockOutputApi.PresubmitResult.__init__(self, message, items, long_text)
+ self.type = 'promptOrNotify'
+
class MockFile(object):
def __init__(self, local_path, new_contents):
@@ -246,19 +251,7 @@ class IncludeOrderTest(unittest.TestCase):
warnings = PRESUBMIT._CheckIncludeOrder(mock_input_api, mock_output_api)
self.assertEqual(1, len(warnings))
self.assertEqual(2, len(warnings[0].items))
- self.assertEqual('warning', warnings[0].type)
-
- def testOnlyNotifyOnCommit(self):
- mock_input_api = MockInputApi()
- mock_input_api.is_committing = True
- mock_output_api = MockOutputApi()
- contents = ['#include <b.h>',
- '#include <a.h>']
- mock_input_api.files = [MockFile('something.cc', contents)]
- warnings = PRESUBMIT._CheckIncludeOrder(mock_input_api, mock_output_api)
- self.assertEqual(1, len(warnings))
- self.assertEqual(1, len(warnings[0].items))
- self.assertEqual('notify', warnings[0].type)
+ self.assertEqual('promptOrNotify', warnings[0].type)
def testUncheckableIncludes(self):
mock_input_api = MockInputApi()