Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 gclient_scm.py.""" | 6 """Unit tests for gclient_scm.py.""" |
| 7 | 7 |
| 8 # Import before super_mox to keep valid references. | 8 # Import before super_mox to keep valid references. |
| 9 from os import rename | 9 from os import rename |
| 10 from shutil import rmtree | 10 from shutil import rmtree |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 687 __builtin__.raw_input.__call__(mox.StrContains('Cannot fast-forward merge, ' | 687 __builtin__.raw_input.__call__(mox.StrContains('Cannot fast-forward merge, ' |
| 688 'attempt to rebase? (y)es / ' | 688 'attempt to rebase? (y)es / ' |
| 689 '(q)uit / (s)kip : ') | 689 '(q)uit / (s)kip : ') |
| 690 ).AndReturn('y') | 690 ).AndReturn('y') |
| 691 self.mox.ReplayAll() | 691 self.mox.ReplayAll() |
| 692 exception = \ | 692 exception = \ |
| 693 'Conflict while rebasing this branch.\n' \ | 693 'Conflict while rebasing this branch.\n' \ |
| 694 'Fix the conflict and run gclient again.\n' \ | 694 'Fix the conflict and run gclient again.\n' \ |
| 695 "See 'man git-rebase' for details.\n" | 695 "See 'man git-rebase' for details.\n" |
| 696 self.assertRaisesError(exception, scm.update, options, (), []) | 696 self.assertRaisesError(exception, scm.update, options, (), []) |
| 697 exception = \ | 697 exception = \ |
|
M-A Ruel
2010/05/28 15:55:50
Please use () instead.
exception = ('\n...'
| |
| 698 '\n____ . at refs/heads/master\n' \ | 698 '\n____ . at refs/heads/master\n' \ |
| 699 '\tAlready in a conflict, i.e. (no branch).\n' \ | 699 '\tYou have unstaged changes.\n' \ |
| 700 '\tFix the conflict and run gclient again.\n' \ | 700 '\tPlease commit, stash, or reset.\n' |
| 701 '\tOr to abort run:\n\t\tgit-rebase --abort\n' \ | |
| 702 '\tSee man git-rebase for details.\n' | |
| 703 self.assertRaisesError(exception, scm.update, options, (), []) | 701 self.assertRaisesError(exception, scm.update, options, (), []) |
| 704 | 702 |
| 705 def testUpdateNotGit(self): | 703 def testUpdateNotGit(self): |
| 706 if not self.enabled: | 704 if not self.enabled: |
| 707 return | 705 return |
| 708 options = self.Options() | 706 options = self.Options() |
| 709 scm = gclient_scm.CreateSCM(url=self.url, root_dir=self.root_dir, | 707 scm = gclient_scm.CreateSCM(url=self.url, root_dir=self.root_dir, |
| 710 relpath=self.relpath) | 708 relpath=self.relpath) |
| 711 git_path = gclient_scm.os.path.join(self.base_path, '.git') | 709 git_path = gclient_scm.os.path.join(self.base_path, '.git') |
| 712 rename(git_path, git_path + 'foo') | 710 rename(git_path, git_path + 'foo') |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 726 relpath=self.relpath) | 724 relpath=self.relpath) |
| 727 rev_info = scm.revinfo(options, (), None) | 725 rev_info = scm.revinfo(options, (), None) |
| 728 self.assertEquals(rev_info, '069c602044c5388d2d15c3f875b057c852003458') | 726 self.assertEquals(rev_info, '069c602044c5388d2d15c3f875b057c852003458') |
| 729 | 727 |
| 730 | 728 |
| 731 if __name__ == '__main__': | 729 if __name__ == '__main__': |
| 732 import unittest | 730 import unittest |
| 733 unittest.main() | 731 unittest.main() |
| 734 | 732 |
| 735 # vim: ts=2:sw=2:tw=80:et: | 733 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |