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

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

Issue 10689144: Extensions Docs Server: Samples zip files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up and tests Created 8 years, 5 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
« no previous file with comments | « chrome/common/extensions/docs/server2/test_data/subversion_fetcher/trunk/recursive_list/list ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index a14bd303f5fb49d4ce1ad3d2ba3891be85037d56..2c346c270500cd2d376e5f35bf79815e9b986fcd 100644
--- a/chrome/common/extensions/docs/server2/test_urlfetch.py
+++ b/chrome/common/extensions/docs/server2/test_urlfetch.py
@@ -11,8 +11,13 @@ def _ReadFile(filename):
class _MockResponse(object):
def __init__(self):
self.content = ''
+ self.headers = { 'content-type': 'none' }
def fetch(url):
result = _MockResponse()
+ # If a test needs to go into a directory that needs to have the same name as
+ # a file, such as the recursive directory listing subversion_fetcher_test,
+ # remove all .html's not at the end of the path.
+ url = url[:-5].replace('.html', '') + url[-5:]
result.content = _ReadFile(os.path.join('test_data', url))
return result
« no previous file with comments | « chrome/common/extensions/docs/server2/test_data/subversion_fetcher/trunk/recursive_list/list ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698