| 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 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 'some/test/c.html': 'new/c.html', | 55 'some/test/c.html': 'new/c.html', |
| 56 } | 56 } |
| 57 updater.update_all_test_expectations_files(deleted_tests, renamed_test_p
airs) | 57 updater.update_all_test_expectations_files(deleted_tests, renamed_test_p
airs) |
| 58 self.assertMultiLineEqual( | 58 self.assertMultiLineEqual( |
| 59 host.filesystem.read_text_file('/mock-checkout/third_party/WebKit/La
youtTests/TestExpectations'), | 59 host.filesystem.read_text_file('/mock-checkout/third_party/WebKit/La
youtTests/TestExpectations'), |
| 60 ('Bug(test) new/a.html [ Failure ]\n' | 60 ('Bug(test) new/a.html [ Failure ]\n' |
| 61 'Bug(test) new/c.html [ Failure ]\n')) | 61 'Bug(test) new/c.html [ Failure ]\n')) |
| 62 | 62 |
| 63 # Tests for protected methods - pylint: disable=protected-access | 63 # Tests for protected methods - pylint: disable=protected-access |
| 64 | 64 |
| 65 def test_commit_changes(self): |
| 66 host = MockHost() |
| 67 updater = DepsUpdater(host) |
| 68 updater._has_changes = lambda: True |
| 69 updater._commit_changes('dummy message') |
| 70 self.assertEqual( |
| 71 host.executive.calls, |
| 72 [['git', 'commit', '--all', '-F', '-']]) |
| 73 |
| 74 def test_commit_message(self): |
| 75 updater = DepsUpdater(MockHost()) |
| 76 self.assertEqual( |
| 77 updater._commit_message('aaaa', '1111'), |
| 78 'Import 1111\n\nUsing update-w3c-deps in Chromium aaaa.\n\n') |
| 79 |
| 65 def test_cl_description_with_empty_environ(self): | 80 def test_cl_description_with_empty_environ(self): |
| 66 host = MockHost() | 81 host = MockHost() |
| 67 host.executive = MockExecutive(output='Last commit message\n') | 82 host.executive = MockExecutive(output='Last commit message\n') |
| 68 updater = DepsUpdater(host) | 83 updater = DepsUpdater(host) |
| 69 description = updater._cl_description() | 84 description = updater._cl_description() |
| 70 self.assertEqual( | 85 self.assertEqual( |
| 71 description, | 86 description, |
| 72 ('Last commit message\n' | 87 ('Last commit message\n' |
| 73 'TBR=qyearsley@chromium.org\n' | 88 'TBR=qyearsley@chromium.org\n' |
| 74 'NOEXPORT=true')) | 89 'NOEXPORT=true')) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 '--work', | 131 '--work', |
| 117 '--tests-root', | 132 '--tests-root', |
| 118 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' | 133 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' |
| 119 ], | 134 ], |
| 120 [ | 135 [ |
| 121 'git', | 136 'git', |
| 122 'add', | 137 'add', |
| 123 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt/
MANIFEST.json' | 138 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt/
MANIFEST.json' |
| 124 ] | 139 ] |
| 125 ]) | 140 ]) |
| OLD | NEW |