| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 def testProcess(self): | 304 def testProcess(self): |
| 305 self._test_process(self._get_co) | 305 self._test_process(self._get_co) |
| 306 | 306 |
| 307 def _testPrepare(self): | 307 def _testPrepare(self): |
| 308 self._test_prepare(self._get_co(None)) | 308 self._test_prepare(self._get_co(None)) |
| 309 | 309 |
| 310 def testMove(self): | 310 def testMove(self): |
| 311 co = self._get_co(None) | 311 co = self._get_co(None) |
| 312 self._check_move(co) | 312 self._check_move(co) |
| 313 out = subprocess2.check_output( | 313 out = subprocess2.check_output( |
| 314 ['git', 'diff', '--staged', '--name-status'], cwd=co.project_path) | 314 ['git', 'diff', '--staged', '--name-status', '--no-renames'], |
| 315 cwd=co.project_path) |
| 315 out = sorted(out.splitlines()) | 316 out = sorted(out.splitlines()) |
| 316 expected = sorted( | 317 expected = sorted( |
| 317 [ | 318 [ |
| 318 'A\tchromeos/views/webui_menu_widget.h', | 319 'A\tchromeos/views/webui_menu_widget.h', |
| 319 'D\tchromeos/views/DOMui_menu_widget.h', | 320 'D\tchromeos/views/DOMui_menu_widget.h', |
| 320 ]) | 321 ]) |
| 321 self.assertEquals(expected, out) | 322 self.assertEquals(expected, out) |
| 322 | 323 |
| 323 | 324 |
| 324 if __name__ == '__main__': | 325 if __name__ == '__main__': |
| 325 if '-v' in sys.argv: | 326 if '-v' in sys.argv: |
| 326 DEBUGGING = True | 327 DEBUGGING = True |
| 327 logging.basicConfig( | 328 logging.basicConfig( |
| 328 level=logging.DEBUG, | 329 level=logging.DEBUG, |
| 329 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') | 330 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') |
| 330 else: | 331 else: |
| 331 logging.basicConfig( | 332 logging.basicConfig( |
| 332 level=logging.ERROR, | 333 level=logging.ERROR, |
| 333 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') | 334 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') |
| 334 unittest.main() | 335 unittest.main() |
| OLD | NEW |