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

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

Issue 14273035: Docserver: refactor the Handler/ServerInstance relationship into a servlet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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/appengine_wrappers.py
diff --git a/chrome/common/extensions/docs/server2/appengine_wrappers.py b/chrome/common/extensions/docs/server2/appengine_wrappers.py
index be4d00e8b4efcc9853057996484104c2ccae8a15..bf1d6287a13608a6757fd09b9b2407d91accd5d9 100644
--- a/chrome/common/extensions/docs/server2/appengine_wrappers.py
+++ b/chrome/common/extensions/docs/server2/appengine_wrappers.py
@@ -3,6 +3,9 @@
# found in the LICENSE file.
import os
+import re
+from StringIO import StringIO
+import sys
def GetAppVersion():
if 'CURRENT_VERSION_ID' in os.environ:
@@ -20,6 +23,24 @@ def GetAppVersion():
def IsDevServer():
return os.environ.get('SERVER_SOFTWARE', '').find('Development') == 0
+class FakeRequest(object):
+ def __init__(self, path, headers=None):
+ self.path = path
+ self.url = '//localhost/%s' % path
+ self.headers = headers or {}
+
+class FakeResponse(object):
+ def __init__(self):
+ self.status = 200
+ self.out = StringIO()
+ self.headers = {}
+
+ def set_status(self, status):
+ self.status = status
+
+ def clear(self, *args):
+ pass
+
# This will attempt to import the actual App Engine modules, and if it fails,
# they will be replaced with fake modules. This is useful during testing.
try:
@@ -33,9 +54,6 @@ try:
import google.appengine.ext.webapp as webapp
from google.appengine.runtime import DeadlineExceededError
except ImportError:
- import re
- from StringIO import StringIO
-
FAKE_URL_FETCHER_CONFIGURATION = None
def ConfigureFakeUrlFetch(configuration):

Powered by Google App Engine
This is Rietveld 408576698