| 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):
|
|
|