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

Side by Side Diff: tests/git_rebase_update_test.py

Issue 756223002: Change git-rebase-update to always keep branch 'master'. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years 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
« gclient_scm.py ('K') | « git_rebase_update.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 sys 9 import sys
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 with self.repo.open('bob', 'wb') as f: 113 with self.repo.open('bob', 'wb') as f:
114 f.write('testing auto-freeze/thaw') 114 f.write('testing auto-freeze/thaw')
115 115
116 output, _ = self.repo.capture_stdio(self.reup.main) 116 output, _ = self.repo.capture_stdio(self.reup.main)
117 self.assertIn('Cannot rebase-update', output) 117 self.assertIn('Cannot rebase-update', output)
118 118
119 self.repo.run(self.nb.main, ['empty_branch']) 119 self.repo.run(self.nb.main, ['empty_branch'])
120 self.repo.run(self.nb.main, ['--upstream-current', 'empty_branch2']) 120 self.repo.run(self.nb.main, ['--upstream-current', 'empty_branch2'])
121 121
122 self.repo.git('checkout', 'branch_K') 122 self.repo.git('checkout', 'branch_K')
123 self.repo.git('checkout', '-b', 'master', 'origin/master')
M-A Ruel 2014/11/25 20:38:31 This doesn't add coverage for the 2 new lines, not
123 124
124 output, _ = self.repo.capture_stdio(self.reup.main) 125 output, _ = self.repo.capture_stdio(self.reup.main)
125 126
126 self.assertIn('Rebasing: branch_G', output) 127 self.assertIn('Rebasing: branch_G', output)
127 self.assertIn('Rebasing: branch_K', output) 128 self.assertIn('Rebasing: branch_K', output)
128 self.assertIn('Rebasing: branch_L', output) 129 self.assertIn('Rebasing: branch_L', output)
129 self.assertIn('Rebasing: foobar', output) 130 self.assertIn('Rebasing: foobar', output)
130 self.assertIn('Rebasing: sub_K', output) 131 self.assertIn('Rebasing: sub_K', output)
131 self.assertIn('Deleted branch branch_G', output) 132 self.assertIn('Deleted branch branch_G', output)
132 self.assertIn('Deleted branch empty_branch', output) 133 self.assertIn('Deleted branch empty_branch', output)
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 """) 334 """)
334 335
335 336
336 if __name__ == '__main__': 337 if __name__ == '__main__':
337 sys.exit(coverage_utils.covered_main(( 338 sys.exit(coverage_utils.covered_main((
338 os.path.join(DEPOT_TOOLS_ROOT, 'git_rebase_update.py'), 339 os.path.join(DEPOT_TOOLS_ROOT, 'git_rebase_update.py'),
339 os.path.join(DEPOT_TOOLS_ROOT, 'git_new_branch.py'), 340 os.path.join(DEPOT_TOOLS_ROOT, 'git_new_branch.py'),
340 os.path.join(DEPOT_TOOLS_ROOT, 'git_reparent_branch.py'), 341 os.path.join(DEPOT_TOOLS_ROOT, 'git_reparent_branch.py'),
341 os.path.join(DEPOT_TOOLS_ROOT, 'git_rename_branch.py') 342 os.path.join(DEPOT_TOOLS_ROOT, 'git_rename_branch.py')
342 ))) 343 )))
OLDNEW
« gclient_scm.py ('K') | « git_rebase_update.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698