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 import hashlib | 6 import hashlib |
7 import json | 7 import json |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import re | 10 import re |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 # Trailing slash missing. | 125 # Trailing slash missing. |
126 'data', | 126 'data', |
127 ] | 127 ] |
128 try: | 128 try: |
129 self._execute(cmd) | 129 self._execute(cmd) |
130 self.fail() | 130 self.fail() |
131 except subprocess.CalledProcessError: | 131 except subprocess.CalledProcessError: |
132 pass | 132 pass |
133 self._expected_tree([]) | 133 self._expected_tree([]) |
134 | 134 |
| 135 def test_check_abs_path(self): |
| 136 cmd = [ |
| 137 '--mode', 'check', |
| 138 'isolate_test.py', |
| 139 '--', |
| 140 os.path.join(ROOT_DIR, 'isolate_test.py'), |
| 141 ] |
| 142 self._execute(cmd) |
| 143 self._expected_tree(['result']) |
| 144 self._expected_result( |
| 145 False, ['isolate_test.py'], ['isolate_test.py'], False) |
| 146 |
135 def test_hashtable(self): | 147 def test_hashtable(self): |
136 cmd = [ | 148 cmd = [ |
137 '--mode', 'hashtable', | 149 '--mode', 'hashtable', |
138 '--outdir', self.tempdir, | 150 '--outdir', self.tempdir, |
139 'isolate_test.py', | 151 'isolate_test.py', |
140 'data/', | 152 'data/', |
141 ] | 153 ] |
142 self._execute(cmd) | 154 self._execute(cmd) |
143 files = ['isolate_test.py', 'data/test_file1.txt', 'data/test_file2.txt'] | 155 files = ['isolate_test.py', 'data/test_file1.txt', 'data/test_file2.txt'] |
144 data = self._expected_result(True, files, ['./isolate_test.py'], False) | 156 data = self._expected_result(True, files, ['./isolate_test.py'], False) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 if sys.argv[1] == '--ok': | 206 if sys.argv[1] == '--ok': |
195 return 0 | 207 return 0 |
196 if sys.argv[1] == '--fail': | 208 if sys.argv[1] == '--fail': |
197 return 1 | 209 return 1 |
198 | 210 |
199 unittest.main() | 211 unittest.main() |
200 | 212 |
201 | 213 |
202 if __name__ == '__main__': | 214 if __name__ == '__main__': |
203 sys.exit(main()) | 215 sys.exit(main()) |
OLD | NEW |