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

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

Issue 2496633002: W3C auto importer: Add a buildbot job link to CL description. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py
index 1752a90ff9e0d5effd30e339b9c8bee254667d7e..5ebfb63867b80b467d078e9b4af950fc2ebb3266 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py
@@ -6,7 +6,7 @@ import unittest
from webkitpy.w3c.deps_updater import DepsUpdater
from webkitpy.common.host_mock import MockHost
-from webkitpy.common.system.filesystem_mock import MockFileSystem
+from webkitpy.common.system.executive_mock import MockExecutive2
class DepsUpdaterTest(unittest.TestCase):
@@ -59,3 +59,31 @@ class DepsUpdaterTest(unittest.TestCase):
host.filesystem.read_text_file('/mock-checkout/third_party/WebKit/LayoutTests/TestExpectations'),
('Bug(test) new/a.html [ Failure ]\n'
'Bug(test) new/c.html [ Failure ]\n'))
+
+ # Tests for protected methods - pylint: disable=protected-access
+
+ def test_cl_description_with_empty_environ(self):
+ host = MockHost()
+ host.executive = MockExecutive2(output='Last commit message\n')
+ updater = DepsUpdater(host)
+ description = updater._cl_description()
+ self.assertEqual(
+ description,
+ ('Last commit message\n'
+ 'TBR=qyearsley@chromium.org'))
+ self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=%B']])
+
+ def test_cl_description_with_environ_variables(self):
+ host = MockHost()
+ host.executive = MockExecutive2(output='Last commit message\n')
+ updater = DepsUpdater(host)
+ updater.host.environ['BUILDBOT_MASTERNAME'] = 'my.master'
+ updater.host.environ['BUILDBOT_BUILDERNAME'] = 'b'
+ updater.host.environ['BUILDBOT_BUILDNUMBER'] = '123'
+ description = updater._cl_description()
+ self.assertEqual(
+ description,
+ ('Last commit message\n'
+ 'Build: https://build.chromium.org/p/my.master/builders/b/builds/123\n\n'
+ 'TBR=qyearsley@chromium.org'))
+ self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=%B']])
« 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