Chromium Code Reviews| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 """) | 109 """) |
| 110 self.assertEquals(self.repo['A'], self.origin['A']) | 110 self.assertEquals(self.repo['A'], self.origin['A']) |
| 111 self.assertEquals(self.repo['E'], self.origin['E']) | 111 self.assertEquals(self.repo['E'], self.origin['E']) |
| 112 | 112 |
| 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']) | |
| 120 self.repo.run(self.nb.main, ['--upstream_current', 'empty_branch2']) | |
| 121 | |
| 119 self.repo.git('checkout', 'branch_K') | 122 self.repo.git('checkout', 'branch_K') |
| 120 | 123 |
| 121 output, _ = self.repo.capture_stdio(self.reup.main) | 124 output, _ = self.repo.capture_stdio(self.reup.main) |
| 122 | 125 |
| 123 self.assertIn('Rebasing: branch_G', output) | 126 self.assertIn('Rebasing: branch_G', output) |
| 124 self.assertIn('Rebasing: branch_K', output) | 127 self.assertIn('Rebasing: branch_K', output) |
| 125 self.assertIn('Rebasing: branch_L', output) | 128 self.assertIn('Rebasing: branch_L', output) |
| 126 self.assertIn('Rebasing: foobar', output) | 129 self.assertIn('Rebasing: foobar', output) |
| 127 self.assertIn('Rebasing: sub_K', output) | 130 self.assertIn('Rebasing: sub_K', output) |
| 128 self.assertIn('Deleted branch branch_G', output) | 131 self.assertIn('Deleted branch branch_G', output) |
| 132 self.assertIn('Deleted branch empty_branch', output) | |
| 133 self.assertIn('Deleted branch empty_branch2', output) | |
|
agable
2014/03/29 00:02:04
See today's ToT: Would be better to have many smal
| |
| 129 self.assertIn('Reparented branch_K to track origin/master', output) | 134 self.assertIn('Reparented branch_K to track origin/master', output) |
| 130 | 135 |
| 131 self.assertSchema(""" | 136 self.assertSchema(""" |
| 132 A B C D E F G M N O H I J K sub_K | 137 A B C D E F G M N O H I J K sub_K |
| 133 K L | 138 K L |
| 134 O foobar1 foobar2 | 139 O foobar1 foobar2 |
| 135 A old_file | 140 A old_file |
| 136 """) | 141 """) |
| 137 | 142 |
| 138 output, _ = self.repo.capture_stdio(self.reup.main) | 143 output, _ = self.repo.capture_stdio(self.reup.main) |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 328 """) | 333 """) |
| 329 | 334 |
| 330 | 335 |
| 331 if __name__ == '__main__': | 336 if __name__ == '__main__': |
| 332 sys.exit(coverage_utils.covered_main(( | 337 sys.exit(coverage_utils.covered_main(( |
| 333 os.path.join(DEPOT_TOOLS_ROOT, 'git_rebase_update.py'), | 338 os.path.join(DEPOT_TOOLS_ROOT, 'git_rebase_update.py'), |
| 334 os.path.join(DEPOT_TOOLS_ROOT, 'git_new_branch.py'), | 339 os.path.join(DEPOT_TOOLS_ROOT, 'git_new_branch.py'), |
| 335 os.path.join(DEPOT_TOOLS_ROOT, 'git_reparent_branch.py'), | 340 os.path.join(DEPOT_TOOLS_ROOT, 'git_reparent_branch.py'), |
| 336 os.path.join(DEPOT_TOOLS_ROOT, 'git_rename_branch.py') | 341 os.path.join(DEPOT_TOOLS_ROOT, 'git_rename_branch.py') |
| 337 ))) | 342 ))) |
| OLD | NEW |