Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py

Issue 2655783005: Remove extra newlines added to auto-importer CL descriptions. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 def test_commit_message(self): 74 def test_commit_message(self):
75 updater = DepsUpdater(MockHost()) 75 updater = DepsUpdater(MockHost())
76 self.assertEqual( 76 self.assertEqual(
77 updater._commit_message('aaaa', '1111'), 77 updater._commit_message('aaaa', '1111'),
78 'Import 1111\n\n' 78 'Import 1111\n\n'
79 'Using update-w3c-deps in Chromium aaaa.\n\n' 79 'Using update-w3c-deps in Chromium aaaa.\n\n'
80 'NOEXPORT=true') 80 'NOEXPORT=true')
81 81
82 def test_cl_description_with_empty_environ(self): 82 def test_cl_description_with_empty_environ(self):
83 host = MockHost() 83 host = MockHost()
84 host.executive = MockExecutive(output='Last commit message\n') 84 host.executive = MockExecutive(output='Last commit message\n\n')
85 updater = DepsUpdater(host) 85 updater = DepsUpdater(host)
86 description = updater._cl_description() 86 description = updater._cl_description()
87 self.assertEqual( 87 self.assertEqual(
88 description, 88 description,
89 ('Last commit message\n' 89 ('Last commit message\n\n'
90 'TBR=qyearsley@chromium.org\n' 90 'TBR=qyearsley@chromium.org\n'
91 'NOEXPORT=true')) 91 'NOEXPORT=true'))
92 self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=% B']]) 92 self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=% B']])
93 93
94 def test_cl_description_with_environ_variables(self): 94 def test_cl_description_with_environ_variables(self):
95 host = MockHost() 95 host = MockHost()
96 host.executive = MockExecutive(output='Last commit message\n') 96 host.executive = MockExecutive(output='Last commit message\n')
97 updater = DepsUpdater(host) 97 updater = DepsUpdater(host)
98 updater.host.environ['BUILDBOT_MASTERNAME'] = 'my.master' 98 updater.host.environ['BUILDBOT_MASTERNAME'] = 'my.master'
99 updater.host.environ['BUILDBOT_BUILDERNAME'] = 'b' 99 updater.host.environ['BUILDBOT_BUILDERNAME'] = 'b'
100 updater.host.environ['BUILDBOT_BUILDNUMBER'] = '123' 100 updater.host.environ['BUILDBOT_BUILDNUMBER'] = '123'
101 description = updater._cl_description() 101 description = updater._cl_description()
102 self.assertEqual( 102 self.assertEqual(
103 description, 103 description,
104 ('Last commit message\n' 104 ('Last commit message\n'
105 'Build: https://build.chromium.org/p/my.master/builders/b/builds/12 3\n\n' 105 'Build: https://build.chromium.org/p/my.master/builders/b/builds/12 3\n\n'
106 'TBR=qyearsley@chromium.org\n' 106 'TBR=qyearsley@chromium.org\n'
107 'NOEXPORT=true')) 107 'NOEXPORT=true'))
108 self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=% B']]) 108 self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=% B']])
109 109
110 def test_cl_description_moves_noexport_tag(self): 110 def test_cl_description_moves_noexport_tag(self):
111 host = MockHost() 111 host = MockHost()
112 host.executive = MockExecutive(output='Summary\n\nNOEXPORT=true') 112 host.executive = MockExecutive(output='Summary\n\nNOEXPORT=true\n\n')
113 updater = DepsUpdater(host) 113 updater = DepsUpdater(host)
114 description = updater._cl_description() 114 description = updater._cl_description()
115 self.assertEqual( 115 self.assertEqual(
116 description, 116 description,
117 ('Summary\n\n' 117 ('Summary\n\n'
118 'TBR=qyearsley@chromium.org\n' 118 'TBR=qyearsley@chromium.org\n'
119 'NOEXPORT=true')) 119 'NOEXPORT=true'))
120 120
121 def test_generate_manifest_command_not_found(self): 121 def test_generate_manifest_command_not_found(self):
122 # If we're updating csswg-test, then the manifest file won't be found. 122 # If we're updating csswg-test, then the manifest file won't be found.
(...skipping 19 matching lines...) Expand all
142 '--work', 142 '--work',
143 '--tests-root', 143 '--tests-root',
144 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' 144 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt'
145 ], 145 ],
146 [ 146 [
147 'git', 147 'git',
148 'add', 148 'add',
149 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt/ MANIFEST.json' 149 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt/ MANIFEST.json'
150 ] 150 ]
151 ]) 151 ])
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698