Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: android_webview/tools/copyright_scanner_unittest.py

Issue 877583003: [Android WebView] Fix outstanding license check issues on the release bot (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « android_webview/tools/copyright_scanner.py ('k') | android_webview/tools/webview_licenses.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for Copyright Scanner utilities.""" 6 """Unit tests for Copyright Scanner utilities."""
7 7
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 actual = map(normpath, copyright_scanner.FindFiles( 171 actual = map(normpath, copyright_scanner.FindFiles(
172 self.input_api, root_dir, [scan_from], [join('foo', 'third_party')])) 172 self.input_api, root_dir, [scan_from], [join('foo', 'third_party')]))
173 self.assertEqual([], actual) 173 self.assertEqual([], actual)
174 174
175 175
176 class AnalyzeScanResultsTest(SuperMoxTestBase): 176 class AnalyzeScanResultsTest(SuperMoxTestBase):
177 def setUp(self): 177 def setUp(self):
178 SuperMoxTestBase.setUp(self) 178 SuperMoxTestBase.setUp(self)
179 self.input_api = self.mox.CreateMockAnything() 179 self.input_api = self.mox.CreateMockAnything()
180 self.input_api.os_path = os.path 180 self.input_api.os_path = os.path
181 self.input_api.change = self.mox.CreateMockAnything()
182 self.input_api.change.RepositoryRoot = lambda: ''
181 183
182 def testAnalyzeScanResults(self): 184 def testAnalyzeScanResults(self):
183 # Tests whitelisted vs. current files state logic. 185 # Tests whitelisted vs. current files state logic.
184 # 186 #
185 # Whitelisted - in whitelist, and contains 3rd party code => OK 187 # Whitelisted - in whitelist, and contains 3rd party code => OK
186 # Missing - in whitelist, but doesn't exist 188 # Missing - in whitelist, but doesn't exist
187 # Stale - in whitelist, but is clean 189 # Stale - in whitelist, but is clean
188 # Unknown - not in whitelist, but contains 3rd party code 190 # Unknown - not in whitelist, but contains 3rd party code
189 self.input_api.os_path.isfile = lambda x: x != 'Missing' 191 self.input_api.os_path.isfile = lambda x: x != 'Missing'
190 self.assertEqual( 192 self.assertEqual(
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 self.mox.ReplayAll() 299 self.mox.ReplayAll()
298 copyright_scanner.ScanAtPresubmit(self.input_api, self.output_api) 300 copyright_scanner.ScanAtPresubmit(self.input_api, self.output_api)
299 self.assertEqual( 301 self.assertEqual(
300 ['A_W.cc', 'D_W.cc', 'M_W.cc', 'NM_W.cc'], self.GetWhitelistedFiles()) 302 ['A_W.cc', 'D_W.cc', 'M_W.cc', 'NM_W.cc'], self.GetWhitelistedFiles())
301 self.assertEqual( 303 self.assertEqual(
302 ['A_DW.cc', 'A_NW.cc', 'A_W.cc', 'D_DW.cc', 'D_NW.cc', 'D_W.cc', 304 ['A_DW.cc', 'A_NW.cc', 'A_W.cc', 'D_DW.cc', 'D_NW.cc', 'D_W.cc',
303 'M_DW.cc', 'M_NW.cc', 'M_W.cc', 'NM_W.cc' ], self.GetFilesToCheck()) 305 'M_DW.cc', 'M_NW.cc', 'M_W.cc', 'NM_W.cc' ], self.GetFilesToCheck())
304 306
305 if __name__ == '__main__': 307 if __name__ == '__main__':
306 unittest.main() 308 unittest.main()
OLDNEW
« no previous file with comments | « android_webview/tools/copyright_scanner.py ('k') | android_webview/tools/webview_licenses.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698