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 checkout.py.""" | 6 """Unit tests for checkout.py.""" |
7 | 7 |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import shutil | 10 import shutil |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 self.assertNotEqual(False, post_processors) | 439 self.assertNotEqual(False, post_processors) |
440 return checkout.GitCheckout( | 440 return checkout.GitCheckout( |
441 root_dir=self.root_dir, | 441 root_dir=self.root_dir, |
442 project_name=self.name, | 442 project_name=self.name, |
443 remote_branch='master', | 443 remote_branch='master', |
444 git_url=os.path.join(self.FAKE_REPOS.git_root, | 444 git_url=os.path.join(self.FAKE_REPOS.git_root, |
445 self.FAKE_REPOS.TEST_GIT_REPO), | 445 self.FAKE_REPOS.TEST_GIT_REPO), |
446 commit_user=self.usr, | 446 commit_user=self.usr, |
447 post_processors=post_processors) | 447 post_processors=post_processors) |
448 | 448 |
449 def disabled_testAll(self): | 449 def testAll(self): |
450 root = os.path.join(self.root_dir, self.name) | 450 root = os.path.join(self.root_dir, self.name) |
451 self._check_base(self._get_co(None), root, None) | 451 self._check_base(self._get_co(None), root, None) |
452 | 452 |
453 def disabled_testException(self): | 453 def testException(self): |
454 self._check_exception( | 454 self._check_exception( |
455 self._get_co(None), | 455 self._get_co(None), |
456 'While running git apply --index -p1;\n fatal: corrupt patch at line ' | 456 'While running git apply --index -p1;\n fatal: corrupt patch at line ' |
457 '12\n') | 457 '12\n') |
458 | 458 |
459 def disabled_testProcess(self): | 459 def testProcess(self): |
460 self._test_process(self._get_co) | 460 self._test_process(self._get_co) |
461 | 461 |
462 def _testPrepare(self): | 462 def _testPrepare(self): |
463 self._test_prepare(self._get_co(None)) | 463 self._test_prepare(self._get_co(None)) |
464 | 464 |
465 def disabled_testMove(self): | 465 def testMove(self): |
466 co = self._get_co(None) | 466 co = self._get_co(None) |
467 self._check_move(co) | 467 self._check_move(co) |
468 out = subprocess2.check_output( | 468 out = subprocess2.check_output( |
469 ['git', 'diff', 'HEAD~', '--name-status'], cwd=co.project_path) | 469 ['git', 'diff', 'HEAD~', '--name-status'], cwd=co.project_path) |
470 out = sorted(out.splitlines()) | 470 out = sorted(out.splitlines()) |
471 expected = sorted( | 471 expected = sorted( |
472 [ | 472 [ |
473 'A\tchromeos/views/webui_menu_widget.h', | 473 'A\tchromeos/views/webui_menu_widget.h', |
474 'D\tchromeos/views/DOMui_menu_widget.h', | 474 'D\tchromeos/views/DOMui_menu_widget.h', |
475 ]) | 475 ]) |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 if '-v' in sys.argv: | 724 if '-v' in sys.argv: |
725 DEBUGGING = True | 725 DEBUGGING = True |
726 logging.basicConfig( | 726 logging.basicConfig( |
727 level=logging.DEBUG, | 727 level=logging.DEBUG, |
728 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') | 728 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') |
729 else: | 729 else: |
730 logging.basicConfig( | 730 logging.basicConfig( |
731 level=logging.ERROR, | 731 level=logging.ERROR, |
732 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') | 732 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') |
733 unittest.main() | 733 unittest.main() |
OLD | NEW |