Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Chromium_Depot_tools
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
Chromium_Depot_tools
Commits
091b7db6
Commit
091b7db6
authored
Jun 16, 2016
by
dcheng
Committed by
Commit bot
Jun 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose fnmatch in presubmit's input_api.
BUG=611905 Review-Url:
https://codereview.chromium.org/2070493002
parent
adf9f0db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
13 deletions
+55
-13
presubmit_support.py
presubmit_support.py
+2
-1
presubmit_unittest.py
tests/presubmit_unittest.py
+53
-12
No files found.
presubmit_support.py
View file @
091b7db6
...
...
@@ -16,7 +16,7 @@ import cpplint
import
cPickle
# Exposed through the API.
import
cStringIO
# Exposed through the API.
import
contextlib
import
fnmatch
import
fnmatch
# Exposed through the API.
import
glob
import
inspect
import
itertools
...
...
@@ -348,6 +348,7 @@ class InputApi(object):
self
.
cPickle
=
cPickle
self
.
cpplint
=
cpplint
self
.
cStringIO
=
cStringIO
self
.
fnmatch
=
fnmatch
self
.
glob
=
glob
.
glob
self
.
json
=
json
self
.
logging
=
logging
.
getLogger
(
'PRESUBMIT'
)
...
...
tests/presubmit_unittest.py
View file @
091b7db6
...
...
@@ -1190,17 +1190,58 @@ class InputApiUnittest(PresubmitTestsBase):
def
testMembersChanged
(
self
):
self
.
mox
.
ReplayAll
()
members
=
[
'AbsoluteLocalPaths'
,
'AffectedFiles'
,
'AffectedSourceFiles'
,
'AffectedTextFiles'
,
'DEFAULT_BLACK_LIST'
,
'DEFAULT_WHITE_LIST'
,
'DepotToLocalPath'
,
'FilterSourceFile'
,
'LocalPaths'
,
'LocalToDepotPath'
,
'Command'
,
'RunTests'
,
'PresubmitLocalPath'
,
'ReadFile'
,
'RightHandSideLines'
,
'ServerPaths'
,
'basename'
,
'cPickle'
,
'cpplint'
,
'cStringIO'
,
'canned_checks'
,
'change'
,
'cpu_count'
,
'environ'
,
'glob'
,
'host_url'
,
'is_committing'
,
'json'
,
'logging'
,
'marshal'
,
'os_listdir'
,
'os_walk'
,
'os_path'
,
'os_stat'
,
'owners_db'
,
'pickle'
,
'platform'
,
'python_executable'
,
're'
,
'rietveld'
,
'subprocess'
,
'tbr'
,
'tempfile'
,
'time'
,
'traceback'
,
'unittest'
,
'urllib2'
,
'version'
,
'verbose'
,
'dry_run'
,
'gerrit'
,
'AbsoluteLocalPaths'
,
'AffectedFiles'
,
'AffectedSourceFiles'
,
'AffectedTextFiles'
,
'DEFAULT_BLACK_LIST'
,
'DEFAULT_WHITE_LIST'
,
'DepotToLocalPath'
,
'FilterSourceFile'
,
'LocalPaths'
,
'LocalToDepotPath'
,
'Command'
,
'RunTests'
,
'PresubmitLocalPath'
,
'ReadFile'
,
'RightHandSideLines'
,
'ServerPaths'
,
'basename'
,
'cPickle'
,
'cpplint'
,
'cStringIO'
,
'canned_checks'
,
'change'
,
'cpu_count'
,
'environ'
,
'fnmatch'
,
'glob'
,
'host_url'
,
'is_committing'
,
'json'
,
'logging'
,
'marshal'
,
'os_listdir'
,
'os_walk'
,
'os_path'
,
'os_stat'
,
'owners_db'
,
'pickle'
,
'platform'
,
'python_executable'
,
're'
,
'rietveld'
,
'subprocess'
,
'tbr'
,
'tempfile'
,
'time'
,
'traceback'
,
'unittest'
,
'urllib2'
,
'version'
,
'verbose'
,
'dry_run'
,
'gerrit'
,
]
# If this test fails, you should add the relevant test.
self
.
compareMembers
(
...
...
@@ -2735,7 +2776,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
"sender"
:
"ben@example.com"
,
"text"
:
"foo"
,
"approval"
:
False
,
},
],
"reviewers"
:[],
"reviewers"
:
[],
}
self
.
AssertOwnersWorks
(
approvers
=
set
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment