| 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 collections | 5 import collections |
| 6 | 6 |
| 7 from webkitpy.common.checkout.git_mock import MockGit | 7 from webkitpy.common.checkout.git_mock import MockGit |
| 8 from webkitpy.common.host_mock import MockHost | 8 from webkitpy.common.host_mock import MockHost |
| 9 from webkitpy.common.system.executive_mock import MockExecutive | 9 from webkitpy.common.system.executive_mock import MockExecutive |
| 10 from webkitpy.common.system.log_testing import LoggingTestCase | 10 from webkitpy.common.system.log_testing import LoggingTestCase |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 def test_get_directory_owners(self): | 166 def test_get_directory_owners(self): |
| 167 host = MockHost() | 167 host = MockHost() |
| 168 host.filesystem.write_text_file( | 168 host.filesystem.write_text_file( |
| 169 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
', | 169 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
', |
| 170 '## Owners: someone@chromium.org\n' | 170 '## Owners: someone@chromium.org\n' |
| 171 '# external/wpt/foo [ Pass ]\n') | 171 '# external/wpt/foo [ Pass ]\n') |
| 172 git = MockGit() | 172 git = MockGit() |
| 173 git.changed_files = lambda: ['third_party/WebKit/LayoutTests/external/wp
t/foo/x.html'] | 173 git.changed_files = lambda: ['third_party/WebKit/LayoutTests/external/wp
t/foo/x.html'] |
| 174 host.git = lambda: git | 174 host.git = lambda: git |
| 175 importer = TestImporter(host) | 175 importer = TestImporter(host) |
| 176 self.assertEqual(importer.get_directory_owners(), {'someone@chromium.org
': 'external/wpt/foo'}) | 176 self.assertEqual(importer.get_directory_owners(), {'someone@chromium.org
': ['external/wpt/foo']}) |
| 177 | 177 |
| 178 def test_get_directory_owners_no_changed_files(self): | 178 def test_get_directory_owners_no_changed_files(self): |
| 179 host = MockHost() | 179 host = MockHost() |
| 180 host.filesystem.write_text_file( | 180 host.filesystem.write_text_file( |
| 181 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
', | 181 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
', |
| 182 '## Owners: someone@chromium.org\n' | 182 '## Owners: someone@chromium.org\n' |
| 183 '# external/wpt/foo [ Pass ]\n') | 183 '# external/wpt/foo [ Pass ]\n') |
| 184 importer = TestImporter(host) | 184 importer = TestImporter(host) |
| 185 self.assertEqual(importer.get_directory_owners(), {}) | 185 self.assertEqual(importer.get_directory_owners(), {}) |
| OLD | NEW |