OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import json | 5 import json |
6 import os | 6 import os |
7 import re | 7 import re |
8 import subprocess | 8 import subprocess |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 This class can be used to form the mock list of changed files in | 91 This class can be used to form the mock list of changed files in |
92 MockInputApi for presubmit unittests. | 92 MockInputApi for presubmit unittests. |
93 """ | 93 """ |
94 | 94 |
95 def __init__(self, local_path, new_contents): | 95 def __init__(self, local_path, new_contents): |
96 self._local_path = local_path | 96 self._local_path = local_path |
97 self._new_contents = new_contents | 97 self._new_contents = new_contents |
98 self._changed_contents = [(i + 1, l) for i, l in enumerate(new_contents)] | 98 self._changed_contents = [(i + 1, l) for i, l in enumerate(new_contents)] |
99 | 99 |
| 100 def Action(self): |
| 101 return 'A' # TODO(dbeam): feel free to change if your test actually uses. |
| 102 |
100 def ChangedContents(self): | 103 def ChangedContents(self): |
101 return self._changed_contents | 104 return self._changed_contents |
102 | 105 |
103 def NewContents(self): | 106 def NewContents(self): |
104 return self._new_contents | 107 return self._new_contents |
105 | 108 |
106 def LocalPath(self): | 109 def LocalPath(self): |
107 return self._local_path | 110 return self._local_path |
108 | 111 |
109 def rfind(self, p): | 112 def rfind(self, p): |
(...skipping 15 matching lines...) Expand all Loading... |
125 | 128 |
126 This class can be used in presubmit unittests to mock the query of the | 129 This class can be used in presubmit unittests to mock the query of the |
127 current change. | 130 current change. |
128 """ | 131 """ |
129 | 132 |
130 def __init__(self, changed_files): | 133 def __init__(self, changed_files): |
131 self._changed_files = changed_files | 134 self._changed_files = changed_files |
132 | 135 |
133 def LocalPaths(self): | 136 def LocalPaths(self): |
134 return self._changed_files | 137 return self._changed_files |
OLD | NEW |