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

Unified Diff: tests/git_cl_test.py

Issue 1799553003: Stop installing Gerrit commit-msg hooks in git cl config. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: fix todo Created 4 years, 9 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 6f0eea4af071d1e9e42c401571ce40205df31874..b276b0a72d43b24baba89870d17e9ef857457545 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -777,87 +777,6 @@ class TestGitCl(TestCase):
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):
- keyvals = {}
- keyvals['CODE_REVIEW_SERVER'] = 'gerrit.chromium.org'
- keyvals['GERRIT_HOST'] = 'True'
- return keyvals
- self.mock(git_cl.gclient_utils, 'ParseCodereviewSettingsContent',
- ParseCodereviewSettingsContent)
- self.mock(git_cl.os, 'access', self._mocked_call)
- self.mock(git_cl.os, 'chmod', self._mocked_call)
- src_dir = os.path.join(os.path.sep, 'usr', 'local', 'src')
- def AbsPath(path):
- if not path.startswith(os.path.sep):
- return os.path.join(src_dir, path)
- return path
- self.mock(git_cl.os.path, 'abspath', AbsPath)
- commit_msg_path = os.path.join(src_dir, '.git', 'hooks', 'commit-msg')
- def Exists(path):
- if path == commit_msg_path:
- return False
- # others paths, such as /usr/share/locale/....
- return True
- self.mock(git_cl.os.path, 'exists', Exists)
- self.mock(git_cl, 'urlretrieve', self._mocked_call)
- self.mock(git_cl, 'hasSheBang', self._mocked_call)
- self.calls = [
- ((['git', 'config', 'rietveld.autoupdate'],),
- ''),
- ((['git', 'config', 'rietveld.server',
- 'gerrit.chromium.org'],), ''),
- ((['git', 'config', '--unset-all', 'rietveld.cc'],), ''),
- ((['git', 'config', '--unset-all',
- 'rietveld.private'],), ''),
- ((['git', 'config', '--unset-all',
- 'rietveld.tree-status-url'],), ''),
- ((['git', 'config', '--unset-all',
- 'rietveld.viewvc-url'],), ''),
- ((['git', 'config', '--unset-all',
- 'rietveld.bug-prefix'],), ''),
- ((['git', 'config', '--unset-all',
- 'rietveld.cpplint-regex'],), ''),
- ((['git', 'config', '--unset-all',
- 'rietveld.force-https-commit-url'],), ''),
- ((['git', 'config', '--unset-all',
- 'rietveld.cpplint-ignore-regex'],), ''),
- ((['git', 'config', '--unset-all',
- 'rietveld.project'],), ''),
- ((['git', 'config', '--unset-all',
- 'rietveld.pending-ref-prefix'],), ''),
- ((['git', 'config', '--unset-all',
- 'rietveld.run-post-upload-hook'],), ''),
- ((['git', 'config', 'gerrit.host', 'True'],), ''),
- # GetCodereviewSettingsInteractively
- ((['git', 'config', 'rietveld.server'],),
- 'gerrit.chromium.org'),
- (('Rietveld server (host[:port]) [https://gerrit.chromium.org]:',),
- ''),
- ((['git', 'config', 'rietveld.cc'],), ''),
- (('CC list:',), ''),
- ((['git', 'config', 'rietveld.private'],), ''),
- (('Private flag (rietveld only):',), ''),
- ((['git', 'config', 'rietveld.tree-status-url'],), ''),
- (('Tree status URL:',), ''),
- ((['git', 'config', 'rietveld.viewvc-url'],), ''),
- (('ViewVC URL:',), ''),
- ((['git', 'config', 'rietveld.bug-prefix'],), ''),
- (('Bug Prefix:',), ''),
- ((['git', 'config', 'rietveld.run-post-upload-hook'],), ''),
- (('Run Post Upload Hook:',), ''),
- # DownloadGerritHook(False)
- ((['git', 'config', 'gerrit.host'],), 'True'),
- ((['git', 'rev-parse', '--show-cdup'],), ''),
- ((commit_msg_path, os.X_OK,), False),
- (('https://gerrit-review.googlesource.com/tools/hooks/commit-msg',
- commit_msg_path,), ''),
- ((commit_msg_path,), True),
- ((commit_msg_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR,), ''),
- ]
- git_cl.main(['config'])
-
def test_update_reviewers(self):
data = [
('foo', [], 'foo'),
« 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