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

Unified Diff: tests/git_cl_test.py

Issue 2274743003: Add a --json option to git cl try-results. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: WIP: Make --json option output the same info as human-readable option; refactor Created 4 years, 4 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 47eaaf7eb32b919d583dcfa1c98709f5f6ac1531..d473516569611d7a782b953cdcf6e08f7afceee4 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -1850,6 +1850,26 @@ class TestGitCl(TestCase):
out.getvalue(),
'scheduled CQ Dry Run on https://codereview.chromium.org/123\n')
+ def test_git_cl_try_results_json(self):
+ # out =
+ # self.mock(git_cl.sys, 'stdout', out)
+ self.mock(git_cl.Changelist, 'GetMostRecentPatchset', lambda *_: 1)
+ self.calls = [
+ ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/my-branch'),
+ ((['git', 'config', 'branch.my-branch.rietveldissue'],), '123'),
+ ((['git', 'config', 'rietveld.autoupdate'],), ''),
+ ((['git', 'config', 'rietveld.server'],),
+ 'https://codereview.chromium.org'),
+ ((['git', 'config', 'branch.my-branch.rietveldpatchset'],), '1'),
+ ((['git', 'config', 'branch.my-branch.merge'],), 'feature'),
+ ((['git', 'config', 'branch.my-branch.remote'],), 'origin'),
+ (('write_json',
+ 'output.json',
+ {'issue': 123,
+ 'issue_url': 'https://codereview.chromium.org/123'}), '')
+ ]
+ pass
iannucci 2016/08/26 18:21:13 this test doesn't look like it tests anything? It
qyearsley 2016/08/26 18:32:13 Yeah, the test isn't written properly yet, I uploa
+
def _common_GerritCommitMsgHookCheck(self):
self.mock(git_cl.sys, 'stdout', StringIO.StringIO())
self.mock(git_cl.os.path, 'abspath',
« 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