OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 import os | 6 import os |
7 import re | 7 import re |
8 import unittest | 8 import unittest |
9 | 9 |
10 import PRESUBMIT | 10 import PRESUBMIT |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 MockFile('other/path/qux.cc', ''), | 362 MockFile('other/path/qux.cc', ''), |
363 ] | 363 ] |
364 results = PRESUBMIT._CheckPatchFiles(mock_input_api, MockOutputApi()) | 364 results = PRESUBMIT._CheckPatchFiles(mock_input_api, MockOutputApi()) |
365 self.assertEqual(0, len(results)) | 365 self.assertEqual(0, len(results)) |
366 | 366 |
367 def testOnlyOwnersFiles(self): | 367 def testOnlyOwnersFiles(self): |
368 mock_change = MockChange([ | 368 mock_change = MockChange([ |
369 'some/path/OWNERS', | 369 'some/path/OWNERS', |
370 'A\Windows\Path\OWNERS', | 370 'A\Windows\Path\OWNERS', |
371 ]) | 371 ]) |
372 results = PRESUBMIT.GetPreferredTrySlaves(None, mock_change) | 372 results = PRESUBMIT.GetPreferredTryMasters(None, mock_change) |
373 self.assertEqual(0, len(results)) | 373 self.assertEqual({}, results) |
374 | 374 |
375 | 375 |
376 class InvalidOSMacroNamesTest(unittest.TestCase): | 376 class InvalidOSMacroNamesTest(unittest.TestCase): |
377 def testInvalidOSMacroNames(self): | 377 def testInvalidOSMacroNames(self): |
378 lines = ['#if defined(OS_WINDOWS)', | 378 lines = ['#if defined(OS_WINDOWS)', |
379 ' #elif defined(OS_WINDOW)', | 379 ' #elif defined(OS_WINDOW)', |
380 ' # if defined(OS_MACOSX) || defined(OS_CHROME)', | 380 ' # if defined(OS_MACOSX) || defined(OS_CHROME)', |
381 '# else // defined(OS_MAC)', | 381 '# else // defined(OS_MAC)', |
382 '#endif // defined(OS_MACOS)'] | 382 '#endif // defined(OS_MACOS)'] |
383 errors = PRESUBMIT._CheckForInvalidOSMacrosInFile( | 383 errors = PRESUBMIT._CheckForInvalidOSMacrosInFile( |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 'policy/DEPS', | 426 'policy/DEPS', |
427 'sandbox/DEPS', | 427 'sandbox/DEPS', |
428 'tools/memory_watcher/DEPS', | 428 'tools/memory_watcher/DEPS', |
429 'third_party/lss/linux_syscall_support.h', | 429 'third_party/lss/linux_syscall_support.h', |
430 ]) | 430 ]) |
431 self.assertEqual(expected, files_to_check); | 431 self.assertEqual(expected, files_to_check); |
432 | 432 |
433 | 433 |
434 if __name__ == '__main__': | 434 if __name__ == '__main__': |
435 unittest.main() | 435 unittest.main() |
OLD | NEW |