| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 self.assertEqual(importer.get_directory_owners(), {}) | 187 self.assertEqual(importer.get_directory_owners(), {}) |
| 188 | 188 |
| 189 def test_cc_part(self): | 189 def test_cc_part(self): |
| 190 directory_owners = { | 190 directory_owners = { |
| 191 ('someone@chromium.org',): ['external/wpt/foo', 'external/wpt/bar'], | 191 ('someone@chromium.org',): ['external/wpt/foo', 'external/wpt/bar'], |
| 192 ('x@chromium.org', 'y@chromium.org'): ['external/wpt/baz'], | 192 ('x@chromium.org', 'y@chromium.org'): ['external/wpt/baz'], |
| 193 } | 193 } |
| 194 self.assertEqual( | 194 self.assertEqual( |
| 195 TestImporter._cc_part(directory_owners), | 195 TestImporter._cc_part(directory_owners), |
| 196 ['--cc=someone@chromium.org', '--cc=x@chromium.org', '--cc=y@chromiu
m.org']) | 196 ['--cc=someone@chromium.org', '--cc=x@chromium.org', '--cc=y@chromiu
m.org']) |
| 197 |
| 198 def test_delete_orphaned_baselines(self): |
| 199 host = MockHost() |
| 200 dest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' |
| 201 host.filesystem.write_text_file(dest_path + '/b-expected.txt', '') |
| 202 host.filesystem.write_text_file(dest_path + '/b.x-expected.txt', '') |
| 203 host.filesystem.write_text_file(dest_path + '/b.x.html', '') |
| 204 importer = TestImporter(host) |
| 205 importer._delete_orphaned_baselines(dest_path) |
| 206 self.assertFalse(host.filesystem.exists(dest_path + '/b-expected.txt')) |
| 207 self.assertTrue(host.filesystem.exists(dest_path + '/b.x-expected.txt')) |
| 208 self.assertTrue(host.filesystem.exists(dest_path + '/b.x.html')) |
| OLD | NEW |