| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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_cl.py.""" | 6 """Unit tests for git_cl.py.""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import StringIO | 9 import StringIO |
| 10 import stat | 10 import stat |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 ((['git', 'config', 'rietveld.cc'],), ''), | 159 ((['git', 'config', 'rietveld.cc'],), ''), |
| 160 ((['git', 'config', 'branch.master.base-url'],), ''), | 160 ((['git', 'config', 'branch.master.base-url'],), ''), |
| 161 ((['git', 'config', '--get-regexp', '^svn-remote\\.'],), | 161 ((['git', 'config', '--get-regexp', '^svn-remote\\.'],), |
| 162 (('', None), 0)), | 162 (('', None), 0)), |
| 163 ((['git', 'rev-parse', '--show-cdup'],), ''), | 163 ((['git', 'rev-parse', '--show-cdup'],), ''), |
| 164 ((['git', 'svn', 'info'],), ''), | 164 ((['git', 'svn', 'info'],), ''), |
| 165 ((['git', 'config', 'branch.master.rietveldissue', '1'],), ''), | 165 ((['git', 'config', 'branch.master.rietveldissue', '1'],), ''), |
| 166 ((['git', 'config', 'branch.master.rietveldserver', | 166 ((['git', 'config', 'branch.master.rietveldserver', |
| 167 'https://codereview.example.com'],), ''), | 167 'https://codereview.example.com'],), ''), |
| 168 ((['git', 'config', 'branch.master.rietveldpatchset', '2'],), ''), | 168 ((['git', 'config', 'branch.master.rietveldpatchset', '2'],), ''), |
| 169 ((['git', 'rev-parse', 'HEAD'],), 'hash'), |
| 170 ((['git', 'symbolic-ref', 'HEAD'],), 'hash'), |
| 171 ((['git', 'config', 'branch.hash.last-upload-hash', 'hash'],), ''), |
| 169 ] | 172 ] |
| 170 | 173 |
| 171 @staticmethod | 174 @staticmethod |
| 172 def _git_sanity_checks(diff_base, working_branch): | 175 def _git_sanity_checks(diff_base, working_branch): |
| 173 fake_ancestor = 'fake_ancestor' | 176 fake_ancestor = 'fake_ancestor' |
| 174 fake_cl = 'fake_cl_for_patch' | 177 fake_cl = 'fake_cl_for_patch' |
| 175 return [ | 178 return [ |
| 176 # Calls to verify branch point is ancestor | 179 # Calls to verify branch point is ancestor |
| 177 ((['git', 'rev-parse', '--verify', diff_base],), fake_ancestor), | 180 ((['git', 'rev-parse', '--verify', diff_base],), fake_ancestor), |
| 178 ((['git', 'merge-base', fake_ancestor, 'HEAD'],), fake_ancestor), | 181 ((['git', 'merge-base', fake_ancestor, 'HEAD'],), fake_ancestor), |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 ((['git', 'config', 'rietveld.viewvc-url'],), ''), | 586 ((['git', 'config', 'rietveld.viewvc-url'],), ''), |
| 584 (('ViewVC URL:',), ''), | 587 (('ViewVC URL:',), ''), |
| 585 # DownloadHooks(True) | 588 # DownloadHooks(True) |
| 586 ((commit_msg_path, os.X_OK,), True), | 589 ((commit_msg_path, os.X_OK,), True), |
| 587 ] | 590 ] |
| 588 git_cl.main(['config']) | 591 git_cl.main(['config']) |
| 589 | 592 |
| 590 | 593 |
| 591 if __name__ == '__main__': | 594 if __name__ == '__main__': |
| 592 unittest.main() | 595 unittest.main() |
| OLD | NEW |