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

Unified Diff: tests/gclient_scm_test.py

Issue 505007: gclient: Add better error reporting when path is not a git repo. (Closed)
Patch Set: Added a test Created 10 years, 11 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 | « gclient_scm.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_scm_test.py
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index 66c1f5e3b335488bf73c33d5126d4e84ea51ec09..61146b4a4d72043ed8aa3ebadca143d7eead1b00 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -16,6 +16,7 @@
"""Unit tests for gclient_scm.py."""
+import os
import shutil
# Import it before super_mox to keep a valid reference.
from subprocess import Popen, PIPE, STDOUT
@@ -541,6 +542,22 @@ from :3
'\tSee man git-rebase for details.\n'
self.assertRaisesError(exception, scm.update, options, (), [])
+ def testUpdateNotGit(self):
+ if not self.enabled:
+ return
+ options = self.Options()
+ scm = gclient_scm.CreateSCM(url=self.url, root_dir=self.root_dir,
+ relpath=self.relpath)
+ git_path = gclient_scm.os.path.join(self.base_path, '.git')
+ os.rename(git_path, git_path + 'foo')
+ exception = \
+ '\n____ .\n' \
+ '\tPath is not a git repo. No .git dir.\n' \
+ '\tTo resolve:\n' \
+ '\t\trm -rf .\n' \
+ '\tAnd run gclient sync again\n'
+ self.assertRaisesError(exception, scm.update, options, (), [])
+
def testRevinfo(self):
if not self.enabled:
return
« no previous file with comments | « gclient_scm.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698