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

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

Issue 15087006: Docserver: there is only one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better redirects Created 7 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/instance_servlet_test.py
diff --git a/chrome/common/extensions/docs/server2/instance_servlet_test.py b/chrome/common/extensions/docs/server2/instance_servlet_test.py
index 0168f1e42034625c2dcf9cdb39345d2219b221c3..e55a5d47dd1080904859a67ff81b8d42061db3ce 100755
--- a/chrome/common/extensions/docs/server2/instance_servlet_test.py
+++ b/chrome/common/extensions/docs/server2/instance_servlet_test.py
@@ -9,36 +9,28 @@ from empty_dir_file_system import EmptyDirFileSystem
from file_system import FileSystem
from instance_servlet import InstanceServlet
from servlet import Request
-from test_branch_utility import TestBranchUtility
from test_file_system import TestFileSystem
from test_util import DisableLogging
# NOTE(kalman): The ObjectStore created by the InstanceServlet is backed onto
# our fake AppEngine memcache/datastore, so the tests aren't isolated.
-class _TestDelegate(InstanceServlet.Delegate):
- def __init__(self, file_system_type):
- self._file_system_type = file_system_type
-
- def CreateBranchUtility(self, object_store_creator):
- return TestBranchUtility()
-
- def CreateHostFileSystemForBranch(self, branch):
- return self._file_system_type()
+class _FailOnAccessDelegate(InstanceServlet.Delegate):
+ def CreateHostFileSystem(self):
+ # All this needs to do is implement GetIdentity. All other methods will
+ # automatically fail with NotImplementedErrors.
+ class FailFS(FileSystem):
+ def GetIdentity(self):
+ return '42'
+ return FailFS()
def CreateAppSamplesFileSystem(self, object_store_creator):
return EmptyDirFileSystem()
-class _FailOnAccessFileSystem(FileSystem):
- # All this needs to do is implement GetIdentity. All other methods will
- # automatically fail with NotImplementedErrors.
- def GetIdentity(self):
- return '42'
-
class InstanceServletTest(unittest.TestCase):
@DisableLogging('warning')
def testHostFileSystemNotAccessed(self):
- delegate = _TestDelegate(_FailOnAccessFileSystem)
- constructor = InstanceServlet.GetConstructor(delegate_for_test=delegate)
+ constructor = InstanceServlet.GetConstructor(
+ delegate_for_test=_FailOnAccessDelegate())
def test_path(path):
response = constructor(Request.ForTest(path)).Get()
self.assertEqual(404, response.status)
@@ -47,11 +39,6 @@ class InstanceServletTest(unittest.TestCase):
test_path('extensions/examples/foo.zip')
test_path('extensions/examples/foo.html')
test_path('static/foo.css')
- test_path('beta/extensions/storage.html')
- test_path('beta/apps/storage.html')
- test_path('beta/extensions/examples/foo.zip')
- test_path('beta/extensions/examples/foo.html')
- test_path('beta/static/foo.css')
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698