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)
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(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(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)