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

Unified Diff: tests/git_common_test.py

Issue 1342383002: Add a git-drover. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 5 years, 3 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 | « man/src/git-drover.demo.3.sh ('k') | tests/git_drover_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/git_common_test.py
diff --git a/tests/git_common_test.py b/tests/git_common_test.py
index e7ec3b425f4235f8de54082a6b67d5dfd96c17e6..ef411ce9dab51ffb9c807eed301c910cbbad8725 100755
--- a/tests/git_common_test.py
+++ b/tests/git_common_test.py
@@ -8,6 +8,7 @@
import binascii
import collections
import os
+import shutil
import signal
import sys
import tempfile
@@ -743,6 +744,35 @@ class GitFreezeThaw(git_test_utils.GitRepoReadWriteTestBase):
self.repo.run(inner)
+class GitMakeWorkdir(git_test_utils.GitRepoReadOnlyTestBase, GitCommonTestBase):
+ def setUp(self):
+ self._tempdir = tempfile.mkdtemp()
+
+ def tearDown(self):
+ shutil.rmtree(self._tempdir)
+
+ REPO_SCHEMA = """
+ A
+ """
+
+ def testMakeWorkdir(self):
+ if not hasattr(os, 'symlink'):
+ return
+
+ workdir = os.path.join(self._tempdir, 'workdir')
+ self.gc.make_workdir(os.path.join(self.repo.repo_path, '.git'),
+ os.path.join(workdir, '.git'))
+ EXPECTED_LINKS = [
+ 'config', 'info', 'hooks', 'logs/refs', 'objects', 'refs',
+ ]
+ for path in EXPECTED_LINKS:
+ self.assertTrue(os.path.islink(os.path.join(workdir, '.git', path)))
+ self.assertEqual(os.path.realpath(os.path.join(workdir, '.git', path)),
+ os.path.join(self.repo.repo_path, '.git', path))
+ self.assertFalse(os.path.islink(os.path.join(workdir, '.git', 'HEAD')))
+
+
+
if __name__ == '__main__':
sys.exit(coverage_utils.covered_main(
os.path.join(DEPOT_TOOLS_ROOT, 'git_common.py')))
« no previous file with comments | « man/src/git-drover.demo.3.sh ('k') | tests/git_drover_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698