def test_can_create_deployment_host_config_for_test2_host(self): """fab.tests.config.rsr.ci_deployment_host_config_test Can create CI deployment host config for test2 host""" expected_test2_host_config = DeploymentHostConfig.create_with( HostAlias.TEST2, RepositoryBranch.DEVELOP, 'test2_rsrdb_develop') self.assertEqual(expected_test2_host_config, CIDeploymentHostConfig.for_test2())
def test_can_parse_standard_configuration_from_given_task_parameters(self): """fab.tests.config.loader.deployment_config_loader_test Can parse a standard configuration from given task parameters""" expected_config = DeploymentHostConfig.create_with(HostAlias.UAT, RepositoryBranch.DEVELOP, 'some_rsrdb') standard_config_spec = '%s:%s;%s;%s' % (ConfigType.STANDARD, HostAlias.UAT, RepositoryBranch.DEVELOP, 'some_rsrdb') self.mox.ReplayAll() self.assertEqual(expected_config, self.config_loader.parse(standard_config_spec))
def _parse_config_spec(self, config_type, config_parameters): if config_type.is_preconfigured(): host_alias = config_parameters[0] if host_alias not in self.preconfigured_hosts: self.feedback.abort('No preconfigured values for host alias: %s' % host_alias) return self.preconfigured_hosts[host_alias] elif config_type.is_standard(): return DeploymentHostConfig.create_with(config_parameters[0], config_parameters[1], config_parameters[2]) elif config_type.is_custom(): return self._custom_config_from(config_parameters[0]) else: self.feedback.abort('Cannot parse host configuration from: %s:%s' % (config_type, ''.join(config_parameters)))
def test_can_parse_standard_configuration_from_given_task_parameters(self): """fab.tests.config.loader.deployment_config_loader_test Can parse a standard configuration from given task parameters""" expected_config = DeploymentHostConfig.create_with( HostAlias.UAT, RepositoryBranch.DEVELOP, 'some_rsrdb') standard_config_spec = '%s:%s;%s;%s' % ( ConfigType.STANDARD, HostAlias.UAT, RepositoryBranch.DEVELOP, 'some_rsrdb') self.mox.ReplayAll() self.assertEqual(expected_config, self.config_loader.parse(standard_config_spec))
def test_can_create_deployment_host_config_for_test2_host(self): """fab.tests.config.rsr.ci_deployment_host_config_test Can create CI deployment host config for test2 host""" expected_test2_host_config = DeploymentHostConfig.create_with(HostAlias.TEST2, RepositoryBranch.DEVELOP, 'test2_rsrdb_develop') self.assertEqual(expected_test2_host_config, CIDeploymentHostConfig.for_test2())