def _can_create_instance_for(self, host_controller_class): rsr_env_path = '/path/to/rsr/env' rsr_app_path = '/path/to/rsr/app' mock_host_controller = self.mox.CreateMock(host_controller_class) mock_host_controller.feedback = self.mox.CreateMock(ExecutionFeedback) mock_host_controller.sudo('chmod a+w %s' % self.rsr_log_file_path) self.mox.ReplayAll() self.assertIsInstance(DjangoSettingsReader.create_with(self.rsr_log_file_path, rsr_env_path, rsr_app_path, mock_host_controller), DjangoSettingsReader)
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(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 _can_create_instance_for(self, host_controller_class): rsr_env_path = '/path/to/rsr/env' rsr_app_path = '/path/to/rsr/app' mock_host_controller = self.mox.CreateMock(host_controller_class) mock_host_controller.feedback = self.mox.CreateMock(ExecutionFeedback) mock_host_controller.sudo('chmod a+w %s' % self.rsr_log_file_path) self.mox.ReplayAll() self.assertIsInstance( DjangoSettingsReader.create_with(self.rsr_log_file_path, rsr_env_path, rsr_app_path, mock_host_controller), DjangoSettingsReader)
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())