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)
Example #3
0
    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)
Example #5
0
    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)
Example #6
0
    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)
Example #8
0
    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)
Example #9
0
    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)
Example #12
0
    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)
Example #13
0
 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))
Example #14
0
 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))