| 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.w3c.deps_updater import DepsUpdater | 7 from webkitpy.w3c.deps_updater import DepsUpdater |
| 8 from webkitpy.common.host_mock import MockHost | 8 from webkitpy.common.host_mock import MockHost |
| 9 from webkitpy.common.system.filesystem_mock import MockFileSystem | 9 from webkitpy.common.system.filesystem_mock import MockFileSystem |
| 10 | 10 |
| 11 | 11 |
| 12 class DepsUpdaterTest(unittest.TestCase): | 12 class DepsUpdaterTest(unittest.TestCase): |
| 13 | 13 |
| 14 def test_parse_try_job_results(self): | 14 def test_parse_try_job_results(self): |
| 15 output = """Successes: | 15 output = """Successes: |
| 16 linux_builder http://example.com/linux_builder/builds/222 | 16 linux_builder http://example.com/linux_builder/builds/222 |
| 17 mac_builder http://example.com/mac_builder/builds/222 | 17 mac_builder http://example.com/mac_builder/builds/222 |
| 18 win_builder http://example.com/win_builder/builds/222 | 18 win_builder http://example.com/win_builder/builds/222 |
| 19 Failures: | 19 Failures: |
| 20 android_builder http://example.com/android_builder/builds/111 | 20 android_builder http://example.com/android_builder/builds/111 |
| 21 chromeos_builder http://example.com/chromeos_builder/builds/111 | 21 chromeos_builder http://example.com/chromeos_builder/builds/111 |
| 22 win_builder http://example.com/win_builder/builds/111 | |
| 23 Started: | 22 Started: |
| 24 chromeos_generic http://example.com/chromeos_generic/builds/111 | 23 chromeos_generic http://example.com/chromeos_generic/builds/111 |
| 25 chromeos_daisy http://example.com/chromeos_daisy/builds/111 | 24 chromeos_daisy http://example.com/chromeos_daisy/builds/111 |
| 26 Total: 8 tryjobs | 25 Total: 8 tryjobs |
| 27 """ | 26 """ |
| 28 host = MockHost() | 27 host = MockHost() |
| 29 updater = DepsUpdater(host) | 28 updater = DepsUpdater(host) |
| 30 self.assertEqual(updater.parse_try_job_results(output), { | 29 self.assertEqual(updater.parse_try_job_results(output), { |
| 31 'Successes': set([ | 30 'Successes': set([ |
| 32 'mac_builder', | 31 'mac_builder', |
| (...skipping 29 matching lines...) Expand all Loading... |
| 62 | 61 |
| 63 def test_is_manual_test_with_corresponding_automation_file(self): | 62 def test_is_manual_test_with_corresponding_automation_file(self): |
| 64 updater = DepsUpdater(MockHost()) | 63 updater = DepsUpdater(MockHost()) |
| 65 imported_dir = '/mock-checkout/third_party/WebKit/LayoutTests/imported/' | 64 imported_dir = '/mock-checkout/third_party/WebKit/LayoutTests/imported/' |
| 66 fs = MockFileSystem(files={ | 65 fs = MockFileSystem(files={ |
| 67 imported_dir + 'wpt_automation/a/x-manual-input.js': '', | 66 imported_dir + 'wpt_automation/a/x-manual-input.js': '', |
| 68 imported_dir + 'wpt_automation/a/y-manual-automation.js': '', | 67 imported_dir + 'wpt_automation/a/y-manual-automation.js': '', |
| 69 }) | 68 }) |
| 70 self.assertTrue(updater.is_manual_test(fs, imported_dir + 'wpt/a', 'x-ma
nual.html')) | 69 self.assertTrue(updater.is_manual_test(fs, imported_dir + 'wpt/a', 'x-ma
nual.html')) |
| 71 self.assertFalse(updater.is_manual_test(fs, imported_dir + 'wpt/a', 'y-m
anual.html')) | 70 self.assertFalse(updater.is_manual_test(fs, imported_dir + 'wpt/a', 'y-m
anual.html')) |
| OLD | NEW |