OLD | NEW |
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 |
11 import unittest | 11 import unittest |
12 | 12 |
13 test_dir = os.path.dirname(os.path.abspath(__file__)) | 13 test_dir = os.path.dirname(os.path.abspath(__file__)) |
14 sys.path.extend([ | 14 sys.path.extend([ |
15 os.path.normpath(os.path.join(test_dir, '..', '..', 'tools')), | 15 os.path.normpath(os.path.join(test_dir, '..', '..', 'build')), |
16 os.path.join(test_dir), | 16 os.path.join(test_dir), |
17 ]) | 17 ]) |
18 | 18 |
19 import find_depot_tools | 19 import find_depot_tools |
20 from testing_support.super_mox import SuperMoxTestBase | 20 from testing_support.super_mox import SuperMoxTestBase |
21 | 21 |
22 import copyright_scanner | 22 import copyright_scanner |
23 | 23 |
24 class FindCopyrightsTest(SuperMoxTestBase): | 24 class FindCopyrightsTest(SuperMoxTestBase): |
25 def setUp(self): | 25 def setUp(self): |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 self.mox.ReplayAll() | 299 self.mox.ReplayAll() |
300 copyright_scanner.ScanAtPresubmit(self.input_api, self.output_api) | 300 copyright_scanner.ScanAtPresubmit(self.input_api, self.output_api) |
301 self.assertEqual( | 301 self.assertEqual( |
302 ['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()) |
303 self.assertEqual( | 303 self.assertEqual( |
304 ['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', |
305 '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()) |
306 | 306 |
307 if __name__ == '__main__': | 307 if __name__ == '__main__': |
308 unittest.main() | 308 unittest.main() |
OLD | NEW |