Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: chrome/common/extensions/docs/server2/test_patcher.py

Issue 15087006: Docserver: there is only one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: epic rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698