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

Unified Diff: tests/git_cl_test.py

Issue 10442028: Fix git_cl_test.py on Windows (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Created 8 years, 7 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 | « no previous file | 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
===================================================================
--- tests/git_cl_test.py (revision 138933)
+++ tests/git_cl_test.py (working copy)
@@ -411,13 +411,15 @@
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('/'):
- return os.path.join('/usr/local/src', 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 == '/usr/local/src/.git/hooks/commit-msg':
+ if path == commit_msg_path:
return False
# others paths, such as /usr/share/locale/....
return True
@@ -434,11 +436,10 @@
((['git', 'config', 'gerrit.host'],), 'gerrit.chromium.org'),
((['git', 'config', 'rietveld.server'],), 'gerrit.chromium.org'),
((['git', 'rev-parse', '--show-cdup'],), ''),
- (('/usr/local/src/.git/hooks/commit-msg', os.X_OK,), False),
+ ((commit_msg_path, os.X_OK,), False),
(('https://gerrit.chromium.org/tools/hooks/commit-msg',
- '/usr/local/src/.git/hooks/commit-msg',), ''),
- (('/usr/local/src/.git/hooks/commit-msg',
- stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR,), ''),
+ commit_msg_path,), ''),
+ ((commit_msg_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR,), ''),
# GetCodereviewSettingsInteractively
((['git', 'config', 'rietveld.server'],), 'gerrit.chromium.org'),
(('Rietveld server (host[:port]) [https://gerrit.chromium.org]:',),
@@ -450,7 +451,7 @@
((['git', 'config', 'rietveld.viewvc-url'],), ''),
(('ViewVC URL:',), ''),
# DownloadHooks(True)
- (('/usr/local/src/.git/hooks/commit-msg', os.X_OK,), True),
+ ((commit_msg_path, os.X_OK,), True),
]
git_cl.main(['config'])
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698