示例#1
0
 def ForTest(file_system, base_path='/'):
     object_store_creator = ObjectStoreCreator.ForTest()
     return ServerInstance(object_store_creator,
                           CompiledFileSystem.Factory(object_store_creator),
                           TestBranchUtility.CreateWithCannedData(),
                           HostFileSystemProvider.ForTest(
                               file_system, object_store_creator),
                           GithubFileSystemProvider.ForEmpty(),
                           base_path=base_path)
示例#2
0
 def ForLocal():
     object_store_creator = ObjectStoreCreator(start_empty=False,
                                               store_type=TestObjectStore)
     host_file_system_provider = HostFileSystemProvider.ForLocal(
         object_store_creator)
     return ServerInstance(object_store_creator,
                           CompiledFileSystem.Factory(object_store_creator),
                           TestBranchUtility.CreateWithCannedData(),
                           host_file_system_provider,
                           GithubFileSystemProvider.ForEmpty())
示例#3
0
 def ForTest(file_system=None, file_system_provider=None, base_path='/'):
     object_store_creator = ObjectStoreCreator.ForTest()
     if file_system is None and file_system_provider is None:
         raise ValueError('Either |file_system| or |file_system_provider| '
                          'must be specified')
     if file_system and file_system_provider:
         raise ValueError(
             'Only one of |file_system| and |file_system_provider| '
             'can be specified')
     if file_system_provider is None:
         file_system_provider = HostFileSystemProvider.ForTest(
             file_system, object_store_creator)
     return ServerInstance(object_store_creator,
                           CompiledFileSystem.Factory(object_store_creator),
                           TestBranchUtility.CreateWithCannedData(),
                           file_system_provider,
                           GithubFileSystemProvider.ForEmpty(),
                           base_path=base_path)
示例#4
0
 def CreateGithubFileSystemProvider(self, object_store_creator):
     return GithubFileSystemProvider.ForEmpty()