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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 self._test_process(self._get_co) | 394 self._test_process(self._get_co) |
395 | 395 |
396 def testPrepare(self): | 396 def testPrepare(self): |
397 self._test_prepare(self._get_co(None)) | 397 self._test_prepare(self._get_co(None)) |
398 | 398 |
399 def testMove(self): | 399 def testMove(self): |
400 co = self._get_co(None) | 400 co = self._get_co(None) |
401 self._check_move(co) | 401 self._check_move(co) |
402 out = subprocess2.check_output( | 402 out = subprocess2.check_output( |
403 ['svn', 'status'], cwd=co.project_path) | 403 ['svn', 'status'], cwd=co.project_path) |
404 expected = ( | 404 out = sorted(out.splitlines()) |
405 'A + chromeos/views/webui_menu_widget.h\n' | 405 expected = sorted( |
406 'D chromeos/views/DOMui_menu_widget.h\n') | 406 [ |
| 407 'A + chromeos/views/webui_menu_widget.h', |
| 408 'D chromeos/views/DOMui_menu_widget.h', |
| 409 ]) |
407 self.assertEquals(expected, out) | 410 self.assertEquals(expected, out) |
408 # Make sure ancestry is what is expected; | 411 # Make sure ancestry is what is expected; |
409 env = os.environ.copy() | 412 env = os.environ.copy() |
410 env['LANGUAGE'] = 'en_US.UTF-8' | 413 env['LANGUAGE'] = 'en_US.UTF-8' |
411 out = subprocess2.check_output( | 414 out = subprocess2.check_output( |
412 ['svn', 'info', 'chromeos/views/webui_menu_widget.h'], | 415 ['svn', 'info', 'chromeos/views/webui_menu_widget.h'], |
413 cwd=co.project_path, | 416 cwd=co.project_path, |
414 env=env) | 417 env=env) |
415 values = dict(l.split(': ', 1) for l in out.splitlines() if l) | 418 values = dict(l.split(': ', 1) for l in out.splitlines() if l) |
416 expected = { | 419 expected = { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 if '-v' in sys.argv: | 537 if '-v' in sys.argv: |
535 DEBUGGING = True | 538 DEBUGGING = True |
536 logging.basicConfig( | 539 logging.basicConfig( |
537 level=logging.DEBUG, | 540 level=logging.DEBUG, |
538 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') | 541 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') |
539 else: | 542 else: |
540 logging.basicConfig( | 543 logging.basicConfig( |
541 level=logging.ERROR, | 544 level=logging.ERROR, |
542 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') | 545 format='%(levelname)5s %(filename)15s(%(lineno)3d): %(message)s') |
543 unittest.main() | 546 unittest.main() |
OLD | NEW |