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

Side by Side Diff: chrome/common/extensions/docs/server2/instance_servlet_test.py

Issue 17397010: Adding AvailabilityFinder to Doc Server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Second Round of Smaller Fixes Created 7 years, 6 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import unittest 6 import unittest
7 7
8 from empty_dir_file_system import EmptyDirFileSystem 8 from empty_dir_file_system import EmptyDirFileSystem
9 from file_system import FileSystem 9 from file_system import FileSystem
10 from instance_servlet import InstanceServlet 10 from instance_servlet import InstanceServlet
11 from servlet import Request 11 from servlet import Request
12 from test_branch_utility import TestBranchUtility 12 from test_branch_utility import TestBranchUtility
13 from test_util import DisableLogging 13 from test_util import DisableLogging
14 14
15 # NOTE(kalman): The ObjectStore created by the InstanceServlet is backed onto 15 # NOTE(kalman): The ObjectStore created by the InstanceServlet is backed onto
16 # our fake AppEngine memcache/datastore, so the tests aren't isolated. 16 # our fake AppEngine memcache/datastore, so the tests aren't isolated.
17 class _TestDelegate(InstanceServlet.Delegate): 17 class _TestDelegate(InstanceServlet.Delegate):
18 def __init__(self, file_system_type): 18 def __init__(self, file_system_type):
19 self._file_system_type = file_system_type 19 self._file_system_type = file_system_type
20 20
21 def CreateBranchUtility(self, object_store_creator): 21 def CreateBranchUtility(self, object_store_creator):
22 return TestBranchUtility() 22 return TestBranchUtility.CreateWithCannedData()
23 23
24 def CreateHostFileSystemForBranch(self, branch): 24 def CreateHostFileSystemForBranch(self, branch):
25 return self._file_system_type() 25 return self._file_system_type()
26 26
27 def CreateAppSamplesFileSystem(self, object_store_creator): 27 def CreateAppSamplesFileSystem(self, object_store_creator):
28 return EmptyDirFileSystem() 28 return EmptyDirFileSystem()
29 29
30 class _FailOnAccessFileSystem(FileSystem): 30 class _FailOnAccessFileSystem(FileSystem):
31 # All this needs to do is implement GetIdentity. All other methods will 31 # All this needs to do is implement GetIdentity. All other methods will
32 # automatically fail with NotImplementedErrors. 32 # automatically fail with NotImplementedErrors.
(...skipping 14 matching lines...) Expand all
47 test_path('extensions/examples/foo.html') 47 test_path('extensions/examples/foo.html')
48 test_path('static/foo.css') 48 test_path('static/foo.css')
49 test_path('beta/extensions/storage.html') 49 test_path('beta/extensions/storage.html')
50 test_path('beta/apps/storage.html') 50 test_path('beta/apps/storage.html')
51 test_path('beta/extensions/examples/foo.zip') 51 test_path('beta/extensions/examples/foo.zip')
52 test_path('beta/extensions/examples/foo.html') 52 test_path('beta/extensions/examples/foo.html')
53 test_path('beta/static/foo.css') 53 test_path('beta/static/foo.css')
54 54
55 if __name__ == '__main__': 55 if __name__ == '__main__':
56 unittest.main() 56 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698