| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 ]) | 144 ]) |
| 145 | 145 |
| 146 def test_get_directory_owners(self): | 146 def test_get_directory_owners(self): |
| 147 host = MockHost() | 147 host = MockHost() |
| 148 host.filesystem.write_text_file( | 148 host.filesystem.write_text_file( |
| 149 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
', | 149 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
', |
| 150 '## Owners: someone@chromium.org\n' | 150 '## Owners: someone@chromium.org\n' |
| 151 '# external/wpt/foo [ Pass ]\n') | 151 '# external/wpt/foo [ Pass ]\n') |
| 152 git = MockGit() | 152 git = MockGit() |
| 153 git.changed_files = lambda: ['third_party/WebKit/LayoutTests/external/wp
t/foo/x.html'] | 153 git.changed_files = lambda: ['third_party/WebKit/LayoutTests/external/wp
t/foo/x.html'] |
| 154 host.scm = lambda: git | 154 host.git = lambda: git |
| 155 importer = TestImporter(host) | 155 importer = TestImporter(host) |
| 156 self.assertEqual(importer.get_directory_owners(), {'someone@chromium.org
': 'external/wpt/foo'}) | 156 self.assertEqual(importer.get_directory_owners(), {'someone@chromium.org
': 'external/wpt/foo'}) |
| 157 | 157 |
| 158 def test_get_directory_owners_no_changed_files(self): | 158 def test_get_directory_owners_no_changed_files(self): |
| 159 host = MockHost() | 159 host = MockHost() |
| 160 host.filesystem.write_text_file( | 160 host.filesystem.write_text_file( |
| 161 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
', | 161 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
', |
| 162 '## Owners: someone@chromium.org\n' | 162 '## Owners: someone@chromium.org\n' |
| 163 '# external/wpt/foo [ Pass ]\n') | 163 '# external/wpt/foo [ Pass ]\n') |
| 164 importer = TestImporter(host) | 164 importer = TestImporter(host) |
| 165 self.assertEqual(importer.get_directory_owners(), {}) | 165 self.assertEqual(importer.get_directory_owners(), {}) |
| OLD | NEW |