OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 ))) |
OLD | NEW |