示例#1
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)
示例#2
0
    def setUp(self):
        super(DataHandlerTest, self).setUp()
        database_credentials = TemplateLoader.load_database_credentials()
        self.expected_admin_credentials = "--user='******' --password='******'" % (
            database_credentials.admin_user,
            database_credentials.admin_password)

        self.mock_feedback = self.mox.CreateMock(ExecutionFeedback)
        self.mock_host_controller = self.mox.CreateMock(RemoteHostController)
        self.mock_host_controller.feedback = self.mock_feedback

        self.data_handler = DataHandler(database_credentials,
                                        self.mock_host_controller)
示例#3
0
    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())