OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 os |
| 6 |
5 def _ReadFile(filename): | 7 def _ReadFile(filename): |
6 with open(filename, 'r') as f: | 8 with open(filename, 'r') as f: |
7 return f.read() | 9 return f.read() |
8 | 10 |
9 class _MockResponse(object): | 11 class _MockResponse(object): |
10 def __init__(self): | 12 def __init__(self): |
11 self.content = '' | 13 self.content = '' |
12 | 14 |
13 def fetch(url): | 15 def fetch(url): |
14 result = _MockResponse() | 16 result = _MockResponse() |
15 result.content = _ReadFile('test_data/' + url) | 17 result.content = _ReadFile(os.path.join('test_data', url)) |
16 return result | 18 return result |
OLD | NEW |