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

Unified Diff: tools/push-to-trunk/test_scripts.py

Issue 98173003: Mock out date call in push-to-trunk script for testability. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 | « tools/push-to-trunk/push_to_trunk.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/test_scripts.py
diff --git a/tools/push-to-trunk/test_scripts.py b/tools/push-to-trunk/test_scripts.py
index 1fd204d47860899431504aae507e9caa1b4b65a2..0262fc0caf3cd59614b6d131735e249a79cb0dad 100644
--- a/tools/push-to-trunk/test_scripts.py
+++ b/tools/push-to-trunk/test_scripts.py
@@ -288,6 +288,9 @@ class ScriptTest(unittest.TestCase):
def Sleep(self, seconds):
pass
+ def GetDate(self):
+ return "1999-07-31"
+
def ExpectGit(self, *args):
"""Convenience wrapper."""
self._git_mock.Expect(*args)
@@ -444,35 +447,33 @@ class ScriptTest(unittest.TestCase):
actual_cl = FileToText(TEST_CONFIG[CHANGELOG_ENTRY_FILE])
- # TODO(machenbach): Mock out call to date() in order to make a fixed
- # comparison here instead of a regexp match.
- expected_cl = """\\d+\\-\\d+\\-\\d+: Version 3\\.22\\.5
+ expected_cl = """1999-07-31: Version 3.22.5
Title text 1.
- Title text 3 \\(Chromium issue 321\\).
+ Title text 3 (Chromium issue 321).
- Performance and stability improvements on all platforms\\.
+ Performance and stability improvements on all platforms.
#
-# The change log above is auto-generated\\. Please review if all relevant
-# commit messages from the list below are included\\.
-# All lines starting with # will be stripped\\.
+# The change log above is auto-generated. Please review if all relevant
+# commit messages from the list below are included.
+# All lines starting with # will be stripped.
#
# Title text 1.
-# \\(author1@chromium\\.org\\)
+# (author1@chromium.org)
#
-# Title text 2 \\(Chromium issue 123\\).
-# \\(author2@chromium\\.org\\)
+# Title text 2 (Chromium issue 123).
+# (author2@chromium.org)
#
-# Title text 3 \\(Chromium issue 321\\).
-# \\(author3@chromium\\.org\\)
+# Title text 3 (Chromium issue 321).
+# (author3@chromium.org)
#
-# Title text 4 \\(Chromium issue 456\\).
-# \\(author4@chromium\\.org\\)
+# Title text 4 (Chromium issue 456).
+# (author4@chromium.org)
#
#"""
- self.assertTrue(re.match(expected_cl, actual_cl))
+ self.assertEquals(expected_cl, actual_cl)
self.assertEquals("3", self.MakeStep().Restore("major"))
self.assertEquals("22", self.MakeStep().Restore("minor"))
self.assertEquals("5", self.MakeStep().Restore("build"))
« no previous file with comments | « tools/push-to-trunk/push_to_trunk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698