diff --git a/presubmit_support.py b/presubmit_support.py index 9449f34bb..d72e81b4b 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -13,10 +13,10 @@ __version__ = '1.8.0' # change). We should add it as our presubmit scripts start feeling slow. import ast # Exposed through the API. -import cpplint +import contextlib import cPickle # Exposed through the API. +import cpplint import cStringIO # Exposed through the API. -import contextlib import fnmatch # Exposed through the API. import glob import inspect @@ -44,7 +44,7 @@ from warnings import warn # Local imports. import fix_encoding -import gclient_utils +import gclient_utils # Exposed through the API import git_footers import gerrit_util import owners @@ -549,15 +549,16 @@ class InputApi(object): self.cpplint = cpplint self.cStringIO = cStringIO self.fnmatch = fnmatch + self.gclient_utils = gclient_utils self.glob = glob.glob self.json = json self.logging = logging.getLogger('PRESUBMIT') + self.marshal = marshal self.os_listdir = os.listdir - self.os_walk = os.walk self.os_path = os.path self.os_stat = os.stat + self.os_walk = os.walk self.pickle = pickle - self.marshal = marshal self.re = re self.subprocess = subprocess self.tempfile = tempfile diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index 9673c48b9..ab0486205 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -936,26 +936,29 @@ class InputApiUnittest(PresubmitTestsBase): 'AffectedSourceFiles', 'AffectedTestableFiles', 'AffectedTextFiles', + 'Command', + 'CreateTemporaryFile', 'DEFAULT_BLACK_LIST', 'DEFAULT_WHITE_LIST', - 'CreateTemporaryFile', 'FilterSourceFile', 'LocalPaths', - 'Command', - 'RunTests', 'PresubmitLocalPath', 'ReadFile', 'RightHandSideLines', + 'RunTests', 'ast', 'basename', - 'cPickle', - 'cpplint', - 'cStringIO', 'canned_checks', 'change', + 'cPickle', + 'cpplint', 'cpu_count', + 'cStringIO', + 'dry_run', 'environ', 'fnmatch', + 'gclient_utils', + 'gerrit', 'glob', 'is_committing', 'is_windows', @@ -963,9 +966,9 @@ class InputApiUnittest(PresubmitTestsBase): 'logging', 'marshal', 'os_listdir', - 'os_walk', 'os_path', 'os_stat', + 'os_walk', 'owners_db', 'owners_finder', 'parallel', @@ -981,10 +984,8 @@ class InputApiUnittest(PresubmitTestsBase): 'traceback', 'unittest', 'urllib2', - 'version', 'verbose', - 'dry_run', - 'gerrit', + 'version', ] # If this test fails, you should add the relevant test. self.compareMembers(