def test_positive_remove_template_by_name(self): """ARemove a provisioning template from organization by its name @Feature: Organization @Assert: Template is removed from the org """ for name in valid_data_list(): with self.subTest(name): org = make_org() template = make_template({ 'content': gen_string('alpha'), 'name': name, }) # Add config-template Org.add_config_template({ 'name': org['name'], 'config-template': template['name'], }) result = Org.info({'name': org['name']}) self.assertIn( u'{0} ({1})'. format(template['name'], template['type']), result['templates'], ) # Remove config-template Org.remove_config_template({ 'config-template': template['name'], 'name': org['name'], }) result = Org.info({'name': org['name']}) self.assertNotIn( u'{0} ({1})'. format(template['name'], template['type']), result['templates'], )
def test_positive_remove_template_by_id(self): """Remove a provisioning template from organization by its ID @id: 8f3e05c2-6c0d-48a6-a311-41ad032b7977 @Assert: Template is removed from the org @CaseLevel: Integration """ org = make_org() template = make_template({'content': gen_string('alpha')}) # Add config-template Org.add_config_template({ 'config-template-id': template['id'], 'id': org['id'], }) result = Org.info({'id': org['id']}) self.assertIn( u'{0} ({1})'. format(template['name'], template['type']), result['templates'], ) # Remove config-template Org.remove_config_template({ 'config-template-id': template['id'], 'id': org['id'], }) result = Org.info({'id': org['id']}) self.assertNotIn( u'{0} ({1})'. format(template['name'], template['type']), result['templates'], )
def test_positive_add_template_by_name(self): """Add a provisioning template to organization by its name @id: bd46a192-488f-4da0-bf47-1f370ae5f55c @Assert: Template is added to the org @CaseLevel: Integration """ for name in valid_data_list(): with self.subTest(name): org = make_org() template = make_template({ 'content': gen_string('alpha'), 'name': name, }) Org.add_config_template({ 'config-template': template['name'], 'name': org['name'], }) org = Org.info({'name': org['name']}) self.assertIn( u'{0} ({1})'. format(template['name'], template['type']), org['templates'] )
def test_positive_remove_template_by_id(self): """Remove a provisioning template from organization by its ID @Feature: Organization @Assert: Template is removed from the org """ org = make_org() template = make_template({'content': gen_string('alpha')}) # Add config-template Org.add_config_template({ 'config-template-id': template['id'], 'id': org['id'], }) result = Org.info({'id': org['id']}) self.assertIn( u'{0} ({1})'. format(template['name'], template['type']), result['templates'], ) # Remove config-template Org.remove_config_template({ 'config-template-id': template['id'], 'id': org['id'], }) result = Org.info({'id': org['id']}) self.assertNotIn( u'{0} ({1})'. format(template['name'], template['type']), result['templates'], )
def test_positive_add_and_remove_templates(self): """Add and remove provisioning templates to organization :id: bd46a192-488f-4da0-bf47-1f370ae5f55c :expectedresults: Templates are handled as expected :steps: 1. Add and remove template by id 2. Add and remove template by name :CaseLevel: Integration """ # create and remove templates by name name = valid_data_list()[0] template = make_template({ 'content': gen_string('alpha'), 'name': name, }) # Add config-template Org.add_config_template({ 'name': self.org['name'], 'config-template': template['name'], }) org_info = Org.info({'name': self.org['name']}) self.assertIn(u'{0} ({1})'.format(template['name'], template['type']), org_info['templates'], "Failed to add template by name") # Remove config-template Org.remove_config_template({ 'config-template': template['name'], 'name': self.org['name'], }) org_info = Org.info({'name': self.org['name']}) self.assertNotIn( u'{0} ({1})'.format(template['name'], template['type']), org_info['templates'], "Failed to remove template by name") # add and remove templates by id # Add config-template Org.add_config_template({ 'config-template-id': template['id'], 'id': self.org['id'], }) org_info = Org.info({'id': self.org['id']}) self.assertIn(u'{0} ({1})'.format(template['name'], template['type']), org_info['templates'], "Failed to add template by name") # Remove config-template Org.remove_config_template({ 'config-template-id': template['id'], 'id': self.org['id'], }) org_info = Org.info({'id': self.org['id']}) self.assertNotIn( u'{0} ({1})'.format(template['name'], template['type']), org_info['templates'], "Failed to remove template by id")
def test_positive_add_template_by_id(self): """Add a provisioning template to organization by its ID @Feature: Organization @Assert: Template is added to the org """ conf_templ = make_template() org = make_org() Org.add_config_template({ 'config-template-id': conf_templ['id'], 'id': org['id'], }) org = Org.info({'id': org['id']}) self.assertIn( u'{0} ({1})'.format(conf_templ['name'], conf_templ['type']), org['templates'] )
def test_positive_add_template_by_id(self): """Add a provisioning template to organization by its ID @id: 4dd119bf-e9e1-4c9a-9b6b-b2c1cc7bc015 @Assert: Template is added to the org @CaseLevel: Integration """ conf_templ = make_template() org = make_org() Org.add_config_template({ 'config-template-id': conf_templ['id'], 'id': org['id'], }) org = Org.info({'id': org['id']}) self.assertIn( u'{0} ({1})'.format(conf_templ['name'], conf_templ['type']), org['templates'] )
def test_positive_add_template_by_name(self): """Add a provisioning template to organization by its name @Feature: Organization @Assert: Template is added to the org """ for name in valid_data_list(): with self.subTest(name): org = make_org() template = make_template({ 'content': gen_string('alpha'), 'name': name, }) Org.add_config_template({ 'config-template': template['name'], 'name': org['name'], }) org = Org.info({'name': org['name']}) self.assertIn( u'{0} ({1})'. format(template['name'], template['type']), org['templates'] )
def test_positive_add_and_remove_templates(self): """Add and remove provisioning templates to organization :id: bd46a192-488f-4da0-bf47-1f370ae5f55c :expectedresults: Templates are handled as expected :steps: 1. Add and remove template by id 2. Add and remove template by name :CaseLevel: Integration """ org = make_org() # create and remove templates by name for name in valid_data_list(): with self.subTest(name): org = make_org() template = make_template({ 'content': gen_string('alpha'), 'name': name, }) # Add config-template Org.add_config_template({ 'name': org['name'], 'config-template': template['name'], }) org_info = Org.info({'name': org['name']}) self.assertIn( u'{0} ({1})'. format(template['name'], template['type']), org_info['templates'], "Failed to add template by name" ) # Remove config-template Org.remove_config_template({ 'config-template': template['name'], 'name': org['name'], }) org_info = Org.info({'name': org['name']}) self.assertNotIn( u'{0} ({1})'. format(template['name'], template['type']), org_info['templates'], "Failed to remove template by name" ) # create and remove templates by id template = make_template({'content': gen_string('alpha')}) # Add config-template Org.add_config_template({ 'config-template-id': template['id'], 'id': org['id'], }) org_info = Org.info({'id': org['id']}) self.assertIn( u'{0} ({1})'. format(template['name'], template['type']), org_info['templates'], "Failed to add template by name" ) # Remove config-template Org.remove_config_template({ 'config-template-id': template['id'], 'id': org['id'], }) org_info = Org.info({'id': org['id']}) self.assertNotIn( u'{0} ({1})'. format(template['name'], template['type']), org_info['templates'], "Failed to remove template by id" )