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

Unified Diff: tests/git_common_test.py

Issue 184113002: Add git-map and git-short-map to depot_tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@new_branch
Patch Set: Make it work on windows Created 6 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 | « testing_support/git_test_utils.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 9b8a495b5008ccbbba3c0abcc0344c6e90adc485..8ecf6a9932b3d537683261053fc2780909ebc07d 100755
--- a/tests/git_common_test.py
+++ b/tests/git_common_test.py
@@ -170,7 +170,7 @@ class GitReadOnlyFunctionsTest(git_test_utils.GitRepoReadOnlyTestBase,
def testHashes(self):
ret = self.repo.run(
- self.gc.hashes, *[
+ self.gc.hash_multi, *[
'master',
'master~3',
self.repo['E']+'~',
@@ -185,6 +185,22 @@ class GitReadOnlyFunctionsTest(git_test_utils.GitRepoReadOnlyTestBase,
self.repo['E'],
self.repo['C'],
], ret)
+ self.assertEquals(
+ self.repo.run(self.gc.hash_one, 'branch_D'),
+ self.repo['D']
+ )
+
+ def testCurrentBranch(self):
+ self.repo.git('checkout', 'branch_D')
+ self.assertEqual(self.repo.run(self.gc.current_branch), 'branch_D')
+
+ def testBranches(self):
+ self.assertEqual(self.repo.run(set, self.gc.branches()),
+ set(('branch_D', 'root_A')))
+
+ def testTags(self):
+ self.assertEqual(set(self.repo.run(self.gc.tags)),
+ {'tag_'+l for l in 'ABCDE'})
def testParseCommitrefs(self):
ret = self.repo.run(
@@ -274,6 +290,24 @@ class GitMutableFunctionsTest(git_test_utils.GitRepoReadWriteTestBase,
tree_hash = self.repo.run(self.gc.mktree, tree)
self.assertEquals('37b61866d6e061c4ba478e7eb525be7b5752737d', tree_hash)
+ def testConfig(self):
+ self.repo.git('config', '--add', 'happy.derpies', 'food')
+ self.assertEquals(self.repo.run(self.gc.config_list, 'happy.derpies'),
+ ['food'])
+ self.assertEquals(self.repo.run(self.gc.config_list, 'sad.derpies'), [])
+
+ self.repo.git('config', '--add', 'happy.derpies', 'cat')
+ self.assertEquals(self.repo.run(self.gc.config_list, 'happy.derpies'),
+ ['food', 'cat'])
+
+ def testUpstream(self):
+ self.repo.git('commit', '--allow-empty', '-am', 'foooooo')
+ self.assertEquals(self.repo.run(self.gc.upstream, 'bobly'), None)
+ self.assertEquals(self.repo.run(self.gc.upstream, 'master'), None)
+ self.repo.git('checkout', '-tb', 'happybranch', 'master')
+ self.assertEquals(self.repo.run(self.gc.upstream, 'happybranch'),
+ 'master')
+
if __name__ == '__main__':
sys.exit(coverage_utils.covered_main(
« no previous file with comments | « testing_support/git_test_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698