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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), | 163 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), |
164 similarity_call, | 164 similarity_call, |
165 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), | 165 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), |
166 find_copies_call, | 166 find_copies_call, |
167 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), | 167 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), |
168 ((['git', 'config', 'branch.master.merge'],), 'master'), | 168 ((['git', 'config', 'branch.master.merge'],), 'master'), |
169 ((['git', 'config', 'branch.master.remote'],), 'origin'), | 169 ((['git', 'config', 'branch.master.remote'],), 'origin'), |
170 ((['get_or_create_merge_base', 'master', 'master'],), | 170 ((['get_or_create_merge_base', 'master', 'master'],), |
171 'fake_ancestor_sha'), | 171 'fake_ancestor_sha'), |
172 ((['git', 'config', 'gerrit.host'],), ''), | 172 ((['git', 'config', 'gerrit.host'],), ''), |
173 ((['git', 'config', 'branch.master.rietveldissue'],), ''), | |
174 ] + cls._git_sanity_checks('fake_ancestor_sha', 'master') + [ | 173 ] + cls._git_sanity_checks('fake_ancestor_sha', 'master') + [ |
175 ((['git', 'rev-parse', '--show-cdup'],), ''), | 174 ((['git', 'rev-parse', '--show-cdup'],), ''), |
176 ((['git', 'rev-parse', 'HEAD'],), '12345'), | 175 ((['git', 'rev-parse', 'HEAD'],), '12345'), |
177 ((['git', 'diff', '--name-status', '--no-renames', '-r', | 176 ((['git', 'diff', '--name-status', '--no-renames', '-r', |
178 'fake_ancestor_sha...', '.'],), | 177 'fake_ancestor_sha...', '.'],), |
179 'M\t.gitignore\n'), | 178 'M\t.gitignore\n'), |
| 179 ((['git', 'config', 'branch.master.rietveldissue'],), ''), |
180 ((['git', 'config', 'branch.master.rietveldpatchset'],), | 180 ((['git', 'config', 'branch.master.rietveldpatchset'],), |
181 ''), | 181 ''), |
182 ((['git', 'log', '--pretty=format:%s%n%n%b', | 182 ((['git', 'log', '--pretty=format:%s%n%n%b', |
183 'fake_ancestor_sha...'],), | 183 'fake_ancestor_sha...'],), |
184 'foo'), | 184 'foo'), |
185 ((['git', 'config', 'user.email'],), 'me@example.com'), | 185 ((['git', 'config', 'user.email'],), 'me@example.com'), |
186 stat_call, | 186 stat_call, |
187 ((['git', 'log', '--pretty=format:%s\n\n%b', | 187 ((['git', 'log', '--pretty=format:%s\n\n%b', |
188 'fake_ancestor_sha..HEAD'],), | 188 'fake_ancestor_sha..HEAD'],), |
189 'desc\n'), | 189 'desc\n'), |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 # Check target refs for pending prefix. | 850 # Check target refs for pending prefix. |
851 self.assertEqual('prefix/heads/master', | 851 self.assertEqual('prefix/heads/master', |
852 git_cl.GetTargetRef('origin', 'refs/remotes/origin/master', | 852 git_cl.GetTargetRef('origin', 'refs/remotes/origin/master', |
853 None, 'prefix/')) | 853 None, 'prefix/')) |
854 | 854 |
855 | 855 |
856 if __name__ == '__main__': | 856 if __name__ == '__main__': |
857 git_cl.logging.basicConfig( | 857 git_cl.logging.basicConfig( |
858 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 858 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
859 unittest.main() | 859 unittest.main() |
OLD | NEW |