| 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.executive_mock import MockExecutive2 | 9 from webkitpy.common.system.executive_mock import MockExecutive2 |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 # Tests for protected methods - pylint: disable=protected-access | 63 # Tests for protected methods - pylint: disable=protected-access |
| 64 | 64 |
| 65 def test_cl_description_with_empty_environ(self): | 65 def test_cl_description_with_empty_environ(self): |
| 66 host = MockHost() | 66 host = MockHost() |
| 67 host.executive = MockExecutive2(output='Last commit message\n') | 67 host.executive = MockExecutive2(output='Last commit message\n') |
| 68 updater = DepsUpdater(host) | 68 updater = DepsUpdater(host) |
| 69 description = updater._cl_description() | 69 description = updater._cl_description() |
| 70 self.assertEqual( | 70 self.assertEqual( |
| 71 description, | 71 description, |
| 72 ('Last commit message\n' | 72 ('Last commit message\n' |
| 73 'TBR=qyearsley@chromium.org')) | 73 'TBR=qyearsley@chromium.org\n' |
| 74 'WPTEXPORT=false')) |
| 74 self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=%
B']]) | 75 self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=%
B']]) |
| 75 | 76 |
| 76 def test_cl_description_with_environ_variables(self): | 77 def test_cl_description_with_environ_variables(self): |
| 77 host = MockHost() | 78 host = MockHost() |
| 78 host.executive = MockExecutive2(output='Last commit message\n') | 79 host.executive = MockExecutive2(output='Last commit message\n') |
| 79 updater = DepsUpdater(host) | 80 updater = DepsUpdater(host) |
| 80 updater.host.environ['BUILDBOT_MASTERNAME'] = 'my.master' | 81 updater.host.environ['BUILDBOT_MASTERNAME'] = 'my.master' |
| 81 updater.host.environ['BUILDBOT_BUILDERNAME'] = 'b' | 82 updater.host.environ['BUILDBOT_BUILDERNAME'] = 'b' |
| 82 updater.host.environ['BUILDBOT_BUILDNUMBER'] = '123' | 83 updater.host.environ['BUILDBOT_BUILDNUMBER'] = '123' |
| 83 description = updater._cl_description() | 84 description = updater._cl_description() |
| 84 self.assertEqual( | 85 self.assertEqual( |
| 85 description, | 86 description, |
| 86 ('Last commit message\n' | 87 ('Last commit message\n' |
| 87 'Build: https://build.chromium.org/p/my.master/builders/b/builds/12
3\n\n' | 88 'Build: https://build.chromium.org/p/my.master/builders/b/builds/12
3\n\n' |
| 88 'TBR=qyearsley@chromium.org')) | 89 'TBR=qyearsley@chromium.org\n' |
| 90 'WPTEXPORT=false')) |
| 89 self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=%
B']]) | 91 self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=%
B']]) |
| OLD | NEW |