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

Unified Diff: tests/git_cl_test.py

Issue 1757133002: git cl: add python implementation of Change-Id generation. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@G050
Patch Set: fix-tests Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/git_cl_test.py
diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py
index 4015bb32b811a25e4905c5687c27cfb5723015a8..f5b3257c067220c5552e58e11ae6545db81a96b9 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -746,6 +746,22 @@ class TestGitCl(TestCase):
self.assertEquals(5, record_calls.times_called)
self.assertEquals(0, ret)
+ def test_gerrit_change_id(self):
+ self.calls = [
+ ((['git', 'write-tree'], ),
+ 'hashtree'),
+ ((['git', 'rev-parse', 'HEAD~0'], ),
+ 'branch-parent'),
+ ((['git', 'var', 'GIT_AUTHOR_IDENT'], ),
+ 'A B <a@b.org> 1456848326 +0100'),
+ ((['git', 'var', 'GIT_COMMITTER_IDENT'], ),
+ 'C D <c@d.org> 1456858326 +0100'),
+ ((['git', 'hash-object', '-t', 'commit', '--stdin'], ),
+ 'hashchange'),
+ ]
+ change_id = git_cl.GenerateGerritChangeId('line1\nline2\n')
+ self.assertEqual(change_id, 'Ihashchange')
+
def test_config_gerrit_download_hook(self):
self.mock(git_cl, 'FindCodereviewSettingsFile', CodereviewSettingsFileMock)
def ParseCodereviewSettingsContent(content):
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698