| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import unittest | 5 import unittest |
| 6 | 6 |
| 7 from webkitpy.common.host_mock import MockHost | 7 from webkitpy.common.host_mock import MockHost |
| 8 from webkitpy.common.system.executive_mock import MockExecutive | 8 from webkitpy.common.system.executive_mock import MockExecutive |
| 9 from webkitpy.w3c.deps_updater import DepsUpdater | 9 from webkitpy.w3c.deps_updater import DepsUpdater |
| 10 | 10 |
| 11 | 11 |
| 12 class DepsUpdaterTest(unittest.TestCase): | 12 class DepsUpdaterTest(unittest.TestCase): |
| 13 | 13 |
| 14 def test_generate_email_list(self): | 14 def test_generate_email_list(self): |
| 15 updater = DepsUpdater(MockHost()) | 15 updater = DepsUpdater(MockHost()) |
| 16 changed_files = [ | 16 changed_files = [ |
| 17 'third_party/WebKit/LayoutTests/foo/bar/file.html', | 17 'third_party/WebKit/LayoutTests/foo/bar/file.html', |
| 18 'third_party/WebKit/LayoutTests/foo/bar/otherfile.html', | 18 'third_party/WebKit/LayoutTests/foo/bar/otherfile.html', |
| 19 'third_party/WebKit/LayoutTests/foo/baz/files.html', | 19 'third_party/WebKit/LayoutTests/foo/baz/files.html', |
| 20 'some/non-test.file', | 20 'some/non-test.file', |
| 21 ] | 21 ] |
| 22 directory_to_owner = { | 22 directory_to_owner = { |
| 23 'foo/bar': 'me@gmail.com', | 23 'foo/bar': 'someone@gmail.com', |
| 24 'foo/baz': 'you@gmail.com', | 24 'foo/baz': 'not an email address', |
| 25 'foo/bat': 'noone@gmail.com', | 25 'foo/bat': 'noone@gmail.com', |
| 26 } | 26 } |
| 27 self.assertEqual( | 27 self.assertEqual( |
| 28 updater.generate_email_list(changed_files, directory_to_owner), | 28 updater.generate_email_list(changed_files, directory_to_owner), |
| 29 ['me@gmail.com', 'you@gmail.com']) | 29 ['someone@gmail.com']) |
| 30 | 30 |
| 31 def test_parse_directory_owners(self): | 31 def test_parse_directory_owners(self): |
| 32 updater = DepsUpdater(MockHost()) | 32 updater = DepsUpdater(MockHost()) |
| 33 data_file = [ | 33 data_file = [ |
| 34 {'notification-email': 'charizard@gmail.com', 'directory': 'foo/bar'
}, | 34 {'notification-email': 'charizard@gmail.com', 'directory': 'foo/bar'
}, |
| 35 {'notification-email': 'blastoise@gmail.com', 'directory': 'foo/baz'
}, | 35 {'notification-email': 'blastoise@gmail.com', 'directory': 'foo/baz'
}, |
| 36 {'notification-email': '', 'directory': 'gol/bat'}, | 36 {'notification-email': '', 'directory': 'gol/bat'}, |
| 37 ] | 37 ] |
| 38 self.assertEqual( | 38 self.assertEqual( |
| 39 updater.parse_directory_owners(data_file), | 39 updater.parse_directory_owners(data_file), |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 '--work', | 142 '--work', |
| 143 '--tests-root', | 143 '--tests-root', |
| 144 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' | 144 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' |
| 145 ], | 145 ], |
| 146 [ | 146 [ |
| 147 'git', | 147 'git', |
| 148 'add', | 148 'add', |
| 149 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt/
MANIFEST.json' | 149 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt/
MANIFEST.json' |
| 150 ] | 150 ] |
| 151 ]) | 151 ]) |
| OLD | NEW |