| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 patch.py.""" | 6 """Unit tests for patch.py.""" |
| 7 | 7 |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import posixpath | 10 import posixpath |
| 11 import sys | 11 import sys |
| 12 import unittest | 12 import unittest |
| 13 | 13 |
| 14 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | 14 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
| 15 | 15 |
| 16 from testing_support.patches_data import GIT, RAW |
| 17 |
| 16 import patch | 18 import patch |
| 17 from tests.patches_data import GIT, RAW | |
| 18 | 19 |
| 19 | 20 |
| 20 class PatchTest(unittest.TestCase): | 21 class PatchTest(unittest.TestCase): |
| 21 def _check_patch(self, | 22 def _check_patch(self, |
| 22 p, | 23 p, |
| 23 filename, | 24 filename, |
| 24 diff, | 25 diff, |
| 25 source_filename=None, | 26 source_filename=None, |
| 26 is_binary=False, | 27 is_binary=False, |
| 27 is_delete=False, | 28 is_delete=False, |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 self.fail() | 452 self.fail() |
| 452 except patch.UnsupportedPatchFormat: | 453 except patch.UnsupportedPatchFormat: |
| 453 pass | 454 pass |
| 454 | 455 |
| 455 | 456 |
| 456 if __name__ == '__main__': | 457 if __name__ == '__main__': |
| 457 logging.basicConfig(level= | 458 logging.basicConfig(level= |
| 458 [logging.WARNING, logging.INFO, logging.DEBUG][ | 459 [logging.WARNING, logging.INFO, logging.DEBUG][ |
| 459 min(2, sys.argv.count('-v'))]) | 460 min(2, sys.argv.count('-v'))]) |
| 460 unittest.main() | 461 unittest.main() |
| OLD | NEW |