def setUp(self): super(FileSystemTest, self).setUp() self.mock_host_controller = self.mox.CreateMock(LocalHostController) self.mock_feedback = self.mox.CreateMock(ExecutionFeedback) self.mock_host_controller.feedback = self.mock_feedback self.file_system = FileSystem(self.mock_host_controller)
def create_with(host_controller): permissions = AkvoPermissions(host_controller) return DeploymentHost(FileSystem(host_controller), DeploymentUserVerifier(permissions), permissions, Internet(host_controller), host_controller.feedback)
def create_with(deployment_host_config, host_controller): return SystemPythonPackageInstaller(deployment_host_config.host_paths, RSRCodebaseConfig(deployment_host_config.repository_branch), SystemPackageInstallationPaths(deployment_host_config.host_paths), PipInstaller.create_with(deployment_host_config, host_controller), FileSystem(host_controller), AkvoPermissions(host_controller), Internet(host_controller), host_controller)
def create_with(virtualenv_installer_config, host_controller): file_system = FileSystem(host_controller) permissions = AkvoPermissions(host_controller) return VirtualEnvDeploymentHost( virtualenv_installer_config, file_system, DeploymentUserVerifier(permissions), permissions, Internet(host_controller), VirtualEnvInstaller.create_with(virtualenv_installer_config, host_controller, file_system), host_controller.feedback)
def create_with(deployment_host_config, host_controller): deployment_config = RSRDeploymentConfig.create_with( deployment_host_config) settings_reader = DjangoSettingsReader.create_with( deployment_config.log_file_path, deployment_config.current_virtualenv_path, deployment_config.rsr_deployment_home, host_controller) return RSRSettingsVerifier(deployment_host_config, deployment_config, settings_reader, FileSystem(host_controller), host_controller.feedback)
def create_with(database_credentials, deployment_host_config, host_controller): data_populator_config = RSRDataPopulatorConfig.create_with( deployment_host_config) django_admin = DjangoAdmin.create_with( data_populator_config.rsr_env_path, data_populator_config.rsr_deployment_home, host_controller) return RSRDataPopulator( data_populator_config, FileSystem(host_controller), LocalFileSystem(), django_admin, DataHandler(database_credentials, host_controller), host_controller.feedback)
def create_with(database_credentials, host_controller): data_retriever_config = RSRDataRetrieverConfig(DataHostPaths()) host_file_system = FileSystem(host_controller) settings_reader = DjangoSettingsReader.create_with(data_retriever_config.rsr_log_file_path, data_retriever_config.rsr_env_path, data_retriever_config.rsr_app_path, host_controller) return RSRDataRetriever(data_retriever_config, host_file_system, LocalFileSystem(), settings_reader, DataHandler(database_credentials, host_controller), host_controller.feedback, TimeStampFormatter())
def create_with(deployment_host_config, host_controller): return PipInstaller( SystemPackageInstallationPaths(deployment_host_config.host_paths), FileSystem(host_controller), Internet(host_controller), host_controller)
def create_with(host_paths): remote_host_controller = RemoteHostController() return RemoteCredentialsFileReader(host_paths, FileSystem(remote_host_controller), remote_host_controller)
def create_with(host_paths, host_controller): return CredentialsFileReader(host_paths, FileSystem(host_controller), host_controller)
def create_with(rsr_log_file_path, rsr_env_path, rsr_app_path, host_controller): return DjangoSettingsReader( rsr_log_file_path, FileSystem(host_controller), DjangoAdmin.create_with(rsr_env_path, rsr_app_path, host_controller))