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

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

Issue 10500004: Die build.py, Die: Part 2 (LocalFetcher, Handlebar support, build script) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added parens Created 8 years, 6 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
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698