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

Side by Side Diff: tests/git_rebase_update_test.py

Issue 1162763003: Fix git branch parsing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix it for real. Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/git_common_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for git_rebase_update.py""" 6 """Unit tests for git_rebase_update.py"""
7 7
8 import os 8 import os
9 import unittest
10 import sys 9 import sys
11 10
12 DEPOT_TOOLS_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 11 DEPOT_TOOLS_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
13 sys.path.insert(0, DEPOT_TOOLS_ROOT) 12 sys.path.insert(0, DEPOT_TOOLS_ROOT)
14 13
15 from testing_support import coverage_utils 14 from testing_support import coverage_utils
16 from testing_support import git_test_utils 15 from testing_support import git_test_utils
17 16
18 class GitRebaseUpdateTest(git_test_utils.GitRepoReadWriteTestBase): 17 class GitRebaseUpdateTest(git_test_utils.GitRepoReadWriteTestBase):
19 REPO_SCHEMA = """ 18 REPO_SCHEMA = """
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 self.repo.git('branch', '--set-upstream-to', 'branch_G', 'branch_K') 61 self.repo.git('branch', '--set-upstream-to', 'branch_G', 'branch_K')
63 self.repo.git('branch', '--set-upstream-to', 'branch_K', 'branch_L') 62 self.repo.git('branch', '--set-upstream-to', 'branch_K', 'branch_L')
64 self.repo.git('branch', '--set-upstream-to', 'origin/master', 'branch_G') 63 self.repo.git('branch', '--set-upstream-to', 'origin/master', 'branch_G')
65 64
66 self.repo.to_schema_refs += ['origin/master'] 65 self.repo.to_schema_refs += ['origin/master']
67 66
68 def tearDown(self): 67 def tearDown(self):
69 self.origin.nuke() 68 self.origin.nuke()
70 super(GitRebaseUpdateTest, self).tearDown() 69 super(GitRebaseUpdateTest, self).tearDown()
71 70
72 @unittest.skip('broken by git 2.4')
73 def testRebaseUpdate(self): 71 def testRebaseUpdate(self):
74 self.repo.git('checkout', 'branch_K') 72 self.repo.git('checkout', 'branch_K')
75 73
76 self.repo.run(self.nb.main, ['foobar']) 74 self.repo.run(self.nb.main, ['foobar'])
77 self.assertEqual(self.repo.git('rev-parse', 'HEAD').stdout, 75 self.assertEqual(self.repo.git('rev-parse', 'HEAD').stdout,
78 self.repo.git('rev-parse', 'origin/master').stdout) 76 self.repo.git('rev-parse', 'origin/master').stdout)
79 77
80 with self.repo.open('foobar', 'w') as f: 78 with self.repo.open('foobar', 'w') as f:
81 f.write('this is the foobar file') 79 f.write('this is the foobar file')
82 self.repo.git('add', 'foobar') 80 self.repo.git('add', 'foobar')
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 M H I J K L 333 M H I J K L
336 """) 334 """)
337 335
338 336
339 if __name__ == '__main__': 337 if __name__ == '__main__':
340 sys.exit(coverage_utils.covered_main(( 338 sys.exit(coverage_utils.covered_main((
341 os.path.join(DEPOT_TOOLS_ROOT, 'git_rebase_update.py'), 339 os.path.join(DEPOT_TOOLS_ROOT, 'git_rebase_update.py'),
342 os.path.join(DEPOT_TOOLS_ROOT, 'git_new_branch.py'), 340 os.path.join(DEPOT_TOOLS_ROOT, 'git_new_branch.py'),
343 os.path.join(DEPOT_TOOLS_ROOT, 'git_reparent_branch.py'), 341 os.path.join(DEPOT_TOOLS_ROOT, 'git_reparent_branch.py'),
344 os.path.join(DEPOT_TOOLS_ROOT, 'git_rename_branch.py') 342 os.path.join(DEPOT_TOOLS_ROOT, 'git_rename_branch.py')
345 ), required_percentage=85.0)) 343 )))
OLDNEW
« no previous file with comments | « tests/git_common_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698