def test_can_create_rsrdeploymentconfig_instance(self): """fab.tests.config.rsr.deployment_config_test Can create RSRDeploymentConfig instance""" self.assertIsInstance( RSRDeploymentConfig.create_with(self.deployment_host_config, self.deployment_user), RSRDeploymentConfig) self.assertIsInstance( RSRDeploymentConfig.create_with(self.deployment_host_config), RSRDeploymentConfig)
def setUp(self): super(RSRAppDeployerTest, self).setUp() self.mock_deployment_host = self.mox.CreateMock(DeploymentHost) self.mock_feedback = self.mox.CreateMock(ExecutionFeedback) self.deployment_config = RSRDeploymentConfig.create_with(CIDeploymentHostConfig.for_test(), "rupaul") self.mock_deployment_host.feedback = self.mock_feedback self.app_deployer = RSRAppDeployer(self.deployment_config, self.mock_deployment_host)
def _create_database_host_instance_with(self, host_controller_class): rsr_deployment_config = RSRDeploymentConfig.create_with(self.deployment_host_config) 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' % rsr_deployment_config.log_file_path) self.mox.ReplayAll() return DatabaseHost.create_with(self.database_credentials, self.deployment_host_config, mock_host_controller)
def setUp(self): super(RSRSettingsVerifierTest, self).setUp() self.deployment_host_config = CIDeploymentHostConfig.for_test() self.deployment_config = RSRDeploymentConfig.create_with(self.deployment_host_config) self.mock_settings_reader = self.mox.CreateMock(DjangoSettingsReader) self.mock_host_file_system = self.mox.CreateMock(FileSystem) self.mock_feedback = self.mox.CreateMock(ExecutionFeedback) self.settings_verifier = RSRSettingsVerifier(self.deployment_host_config, self.deployment_config, self.mock_settings_reader, self.mock_host_file_system, self.mock_feedback)
def setUp(self): super(RSRDataPopulatorConfigTest, self).setUp() self.deployment_host_config = CIDeploymentHostConfig.for_test() self.deployment_config = RSRDeploymentConfig.create_with(self.deployment_host_config) self.codebase_config = RSRCodebaseConfig("some_repo_branch") self.expected_rsr_deployment_home = self.deployment_config.rsr_deployment_home self.data_populator_config = RSRDataPopulatorConfig(self.deployment_config, self.deployment_host_config.host_paths, self.codebase_config)
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 setUp(self): super(RSRDataPopulatorConfigTest, self).setUp() self.deployment_host_config = CIDeploymentHostConfig.for_test() self.deployment_config = RSRDeploymentConfig.create_with( self.deployment_host_config) self.codebase_config = RSRCodebaseConfig("some_repo_branch") self.expected_rsr_deployment_home = self.deployment_config.rsr_deployment_home self.data_populator_config = RSRDataPopulatorConfig( self.deployment_config, self.deployment_host_config.host_paths, self.codebase_config)
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 setUp(self): super(RSRSettingsVerifierTest, self).setUp() self.deployment_host_config = CIDeploymentHostConfig.for_test() self.deployment_config = RSRDeploymentConfig.create_with( self.deployment_host_config) self.mock_settings_reader = self.mox.CreateMock(DjangoSettingsReader) self.mock_host_file_system = self.mox.CreateMock(FileSystem) self.mock_feedback = self.mox.CreateMock(ExecutionFeedback) self.settings_verifier = RSRSettingsVerifier( self.deployment_host_config, self.deployment_config, self.mock_settings_reader, self.mock_host_file_system, self.mock_feedback)
def _create_database_host_instance_with(self, host_controller_class): rsr_deployment_config = RSRDeploymentConfig.create_with( self.deployment_host_config) 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' % rsr_deployment_config.log_file_path) self.mox.ReplayAll() return DatabaseHost.create_with(self.database_credentials, self.deployment_host_config, mock_host_controller)
def setUp(self): super(RSRDeploymentConfigTest, self).setUp() self.deployment_user = '******' self.deployment_host_config = CIDeploymentHostConfig.for_test() self.deployment_host_paths = self.deployment_host_config.host_paths self.codebase_config = RSRCodebaseConfig( self.deployment_host_config.repository_branch) self.expected_rsr_dir_name = 'rsr_%s' % self.codebase_config.repo_branch_without_type self.expected_rsr_deployment_home = os.path.join( self.deployment_host_paths.repo_checkout_home, self.expected_rsr_dir_name) self.expected_current_virtualenv_path = os.path.join( self.deployment_host_paths.virtualenvs_home, 'current') self.deployment_config = RSRDeploymentConfig( self.deployment_host_paths, self.deployment_user, self.codebase_config)
def test_can_create_rsrdeploymentconfig_instance(self): """fab.tests.config.rsr.deployment_config_test Can create RSRDeploymentConfig instance""" self.assertIsInstance(RSRDeploymentConfig.create_with(self.deployment_host_config, self.deployment_user), RSRDeploymentConfig) self.assertIsInstance(RSRDeploymentConfig.create_with(self.deployment_host_config), RSRDeploymentConfig)
def create_with(deployment_host_config): return RSRDataPopulatorConfig(RSRDeploymentConfig.create_with(deployment_host_config), deployment_host_config.host_paths, RSRCodebaseConfig(deployment_host_config.repository_branch))
def create_with(deployment_host_config): return RSRDataPopulatorConfig( RSRDeploymentConfig.create_with(deployment_host_config), deployment_host_config.host_paths, RSRCodebaseConfig(deployment_host_config.repository_branch))