| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from future import Future | 5 from future import Future |
| 6 from patcher import Patcher | 6 from patcher import Patcher |
| 7 | 7 |
| 8 class TestPatcher(Patcher): | 8 class TestPatcher(Patcher): |
| 9 def __init__(self, version, patched_files, patch_data, assert_binary=False): | 9 def __init__(self, version, patched_files, patch_data, assert_binary=False): |
| 10 self._version = version | 10 self._version = version |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 def Apply(self, paths, file_system, binary, version=None): | 27 def Apply(self, paths, file_system, binary, version=None): |
| 28 if self._assert_binary: | 28 if self._assert_binary: |
| 29 assert binary | 29 assert binary |
| 30 self.apply_count += 1 | 30 self.apply_count += 1 |
| 31 try: | 31 try: |
| 32 return Future(value=dict((path, self._patch_data[path]) | 32 return Future(value=dict((path, self._patch_data[path]) |
| 33 for path in paths)) | 33 for path in paths)) |
| 34 except KeyError: | 34 except KeyError: |
| 35 raise FileNotFoundError('One of %s is deleted in the patch.' % paths) | 35 raise FileNotFoundError('One of %s is deleted in the patch.' % paths) |
| 36 |
| 37 def GetIdentity(self): |
| 38 return self.__class__.__name__ |
| OLD | NEW |