def test_if_environment_does_not_exists(github): control_repository = ControlRepository('test_organization', 'test_repository', 'some-token') repository = github().get_organization().get_repo() repository.get_branch.side_effect = GithubException('badstatus', 'missing') with pytest.raises(EnvironmentNotFoundException): control_repository.get_environment('environment')
def take_action(self, parsed_args): organisation, repository, token = get_config_from_environment() control_repository = ControlRepository(organisation, repository, token, parsed_args.url) puppet_environment = control_repository.get_environment( parsed_args.environment[0]) puppetfile = puppet_environment.get_puppetfile() puppetfile.remove_git_module(parsed_args.module[0])
def take_action(self, parsed_args): organisation, repository, token = get_config_from_environment() control_repository = ControlRepository(organisation, repository, token, parsed_args.url) puppet_environment = control_repository.get_environment( parsed_args.name[0]) puppetfile = puppet_environment.get_puppetfile() module_list = puppetfile.list_modules() return (('Name', ), ((module, ) for module in module_list))
def take_action(self, parsed_args): organisation, repository, token = get_config_from_environment() control_repository = ControlRepository(organisation, repository, token, parsed_args.url) puppet_environment = control_repository.get_environment( parsed_args.name[0]) puppetfile = puppet_environment.get_puppetfile() forge_modules = puppetfile.forge_modules return (('Name', 'version'), ((module.name, module.version if module.version else '') for module in forge_modules))
def take_action(self, parsed_args): organisation, repository, token = get_config_from_environment() control_repository = ControlRepository(organisation, repository, token, parsed_args.url) puppet_environment = control_repository.get_environment( parsed_args.name[0]) puppetfile = puppet_environment.get_puppetfile() git_modules = puppetfile.git_modules return (('Name', 'url', 'reference_type', 'referece'), ((module.name, module.git_url, module.reference_type if module.reference_type else '', module.reference if module.reference else '') for module in git_modules))
def take_action(self, parsed_args): if parsed_args.reference or parsed_args.reference_type: if not parsed_args.reference or not parsed_args.reference_type: exit('You must provide either a git reference type and a' 'git reference.') organisation, repository, token = get_config_from_environment() control_repository = ControlRepository(organisation, repository, token, parsed_args.url) puppet_environment = control_repository.get_environment( parsed_args.environment[0]) puppetfile = puppet_environment.get_puppetfile() puppetfile.add_git_module(parsed_args.module[0], parsed_args.url[0], reference_type=parsed_args.reference_type, reference=parsed_args.reference)
def test_it_returns_a_puppet_environment(): control_repository = ControlRepository('test_organization', 'test_repository', 'some-token') puppet_environment = control_repository.get_environment('test') assert isinstance(puppet_environment, Environment)