def test_can_create_rsrdatapopulatorconfig_instance_with_given_deployment_host_config(
            self):
        """fab.tests.config.rsr.data.populator_config_test  Can create RSRDataPopulatorConfig instance with given deployment host config"""

        self.assertIsInstance(
            RSRDataPopulatorConfig.create_with(self.deployment_host_config),
            RSRDataPopulatorConfig)
Beispiel #2
0
    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)
Beispiel #3
0
    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 setUp(self):
        super(RSRDataPopulatorTest, self).setUp()
        self.deployment_host_config = CIDeploymentHostConfig.for_test()
        self.data_populator_config = RSRDataPopulatorConfig.create_with(self.deployment_host_config)
        self.mock_data_host_file_system = self.mox.CreateMock(FileSystem)
        self.mock_local_file_system = self.mox.CreateMock(FileSystem)
        self.mock_django_admin = self.mox.CreateMock(DjangoAdmin)
        self.mock_data_handler = self.mox.CreateMock(DataHandler)
        self.mock_feedback = self.mox.CreateMock(ExecutionFeedback)
        self.mock_last_migration_file = self.mox.CreateMock(file)

        self.latest_data_archive_name = 'rsr_data_20111112.sql.zip'
        self.expected_data_archive_file_path = os.path.join(self.data_populator_config.data_archives_home, self.latest_data_archive_name)
        self.expected_data_extract_file_path = self.expected_data_archive_file_path.rstrip('.zip')

        self.data_populator = StubbedRSRDataPopulator(self.data_populator_config, self.mock_data_host_file_system,
                                                      self.mock_local_file_system, self.mock_django_admin,
                                                      self.mock_data_handler, self.mock_feedback,
                                                      self.mock_last_migration_file)
    def setUp(self):
        super(RSRDataPopulatorTest, self).setUp()
        self.deployment_host_config = CIDeploymentHostConfig.for_test()
        self.data_populator_config = RSRDataPopulatorConfig.create_with(
            self.deployment_host_config)
        self.mock_data_host_file_system = self.mox.CreateMock(FileSystem)
        self.mock_local_file_system = self.mox.CreateMock(FileSystem)
        self.mock_django_admin = self.mox.CreateMock(DjangoAdmin)
        self.mock_data_handler = self.mox.CreateMock(DataHandler)
        self.mock_feedback = self.mox.CreateMock(ExecutionFeedback)
        self.mock_last_migration_file = self.mox.CreateMock(file)

        self.latest_data_archive_name = 'rsr_data_20111112.sql.zip'
        self.expected_data_archive_file_path = os.path.join(
            self.data_populator_config.data_archives_home,
            self.latest_data_archive_name)
        self.expected_data_extract_file_path = self.expected_data_archive_file_path.rstrip(
            '.zip')

        self.data_populator = StubbedRSRDataPopulator(
            self.data_populator_config, self.mock_data_host_file_system,
            self.mock_local_file_system, self.mock_django_admin,
            self.mock_data_handler, self.mock_feedback,
            self.mock_last_migration_file)
    def test_can_create_rsrdatapopulatorconfig_instance_with_given_deployment_host_config(self):
        """fab.tests.config.rsr.data.populator_config_test  Can create RSRDataPopulatorConfig instance with given deployment host config"""

        self.assertIsInstance(RSRDataPopulatorConfig.create_with(self.deployment_host_config), RSRDataPopulatorConfig)