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

Unified Diff: tests/git_common_test.py

Issue 509843002: Give git map-branches extra information behind -v and -vv flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: add # pragma: no cover to compensate for git < 1.9 Created 6 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 | « git_map_branches.py ('k') | no next file » | 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 bba5b43ff8b163a2f4b725a82e8ad02631b219ce..28ecb1408120b840190a5c8c1e8a5e5710263f68 100755
--- a/tests/git_common_test.py
+++ b/tests/git_common_test.py
@@ -207,6 +207,8 @@ class GitReadOnlyFunctionsTest(git_test_utils.GitRepoReadOnlyTestBase,
self.repo.run(self.gc.hash_one, 'branch_D'),
self.repo['D']
)
+ self.assertTrue(self.repo['D'].startswith(
+ self.repo.run(self.gc.hash_one, 'branch_D', short=True)))
def testStream(self):
items = set(self.repo.commit_map.itervalues())
@@ -366,6 +368,55 @@ class GitMutableFunctionsTest(git_test_utils.GitRepoReadWriteTestBase,
self.assertEquals(self.repo.run(self.gc.upstream, 'happybranch'),
'master')
+ def testNormalizedVersion(self):
+ self.assertTrue(all(
+ isinstance(x, int) for x in self.repo.run(self.gc.get_git_version)))
+
+ def testGetAllTrackingInfo(self):
+ self.repo.git('commit', '--allow-empty', '-am', 'foooooo')
+ self.repo.git('checkout', '-tb', 'happybranch', 'master')
+ self.repo.git('commit', '--allow-empty', '-am', 'foooooo')
+ self.repo.git('checkout', '-tb', 'child', 'happybranch')
+
+ self.repo.git('checkout', '-tb', 'to_delete', 'master')
+ self.repo.git('checkout', '-tb', 'parent_gone', 'to_delete')
+ self.repo.git('branch', '-D', 'to_delete')
+
+ actual = self.repo.run(self.gc.get_all_tracking_info)
+ supports_track = (
+ self.repo.run(self.gc.get_git_version)
+ >= self.gc.MIN_UPSTREAM_TRACK_GIT_VERSION)
+
+ expected = {
+ 'happybranch': (
+ self.repo.run(self.gc.hash_one, 'happybranch', short=True),
+ 'master',
+ 1 if supports_track else None,
+ None
+ ),
+ 'child': (
+ self.repo.run(self.gc.hash_one, 'child', short=True),
+ 'happybranch',
+ None,
+ None
+ ),
+ 'master': (
+ self.repo.run(self.gc.hash_one, 'master', short=True),
+ '',
+ None,
+ None
+ ),
+ '': None,
+ 'parent_gone': (
+ self.repo.run(self.gc.hash_one, 'parent_gone', short=True),
+ 'to_delete',
+ 1 if supports_track else None,
+ None
+ ),
+ 'to_delete': None
+ }
+ self.assertEquals(expected, actual)
+
class GitMutableStructuredTest(git_test_utils.GitRepoReadWriteTestBase,
GitCommonTestBase):
« no previous file with comments | « git_map_branches.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698