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

Unified Diff: chrome/common/extensions/docs/server2/test_urlfetch.py

Issue 10387225: Die build.py, Die: Part 1 (BranchUtility and SubversionFetcher) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Resource fetcher Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/test_urlfetch.py
diff --git a/chrome/common/extensions/docs/server2/test_urlfetch.py b/chrome/common/extensions/docs/server2/test_urlfetch.py
new file mode 100644
index 0000000000000000000000000000000000000000..547056ecdb7626f64785f3d4be08e978ea13239e
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/test_urlfetch.py
@@ -0,0 +1,16 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+def ReadFile(filename):
+ with open(filename, 'r') as f:
+ return f.read()
+
+def fetch(url):
+ result = MockResponse()
+ result.content = ReadFile('test_data/' + url)
+ return result
+
Aaron Boodman 2012/05/24 06:10:23 Prefix ReadFile and MockResponse with _ to make cl
cduvall 2012/05/25 20:02:23 Done.
+class MockResponse(object):
Aaron Boodman 2012/05/24 06:10:23 Move this up above fetch()? (I'm surprised it comp
cduvall 2012/05/25 20:02:23 Done.
+ def __init__(self):
+ self.content = ''

Powered by Google App Engine
This is Rietveld 408576698