def test_positive_remove_os_by_id(module_os_with_minor): """Check if operating system can be removed from a template :id: b5362565-6dce-4770-81e1-4fe3ec6f6cee :expectedresults: Operating system is removed from template :CaseLevel: Integration :CaseImportance: Medium :BZ: 1395229 """ template = make_template() Template.add_operatingsystem( {'id': template['id'], 'operatingsystem-id': module_os_with_minor.id} ) template = Template.info({'id': template['id']}) os_string = ( f'{module_os_with_minor.name} {module_os_with_minor.major}.{module_os_with_minor.minor}' ) assert os_string in template['operating-systems'] Template.remove_operatingsystem( {'id': template['id'], 'operatingsystem-id': module_os_with_minor.id} ) template = Template.info({'id': template['id']}) assert os_string not in template['operating-systems']
def test_remove_operating_system_1(self): """@Test: Check if OS can be removed Template @Feature: Template - Remove Operating System @Assert: Template no longer has an operating system """ template = make_template() new_os = make_os() Template.add_operatingsystem({ 'id': template['id'], 'operatingsystem-id': new_os['id'], }) template = Template.info({'id': template['id']}) os_string = '{0} {1}.{2}'.format( new_os['name'], new_os['major-version'], new_os['minor-version'] ) self.assertIn(os_string, template['operating-systems']) Template.remove_operatingsystem({ 'id': template['id'], 'operatingsystem-id': new_os['id'] }) template = Template.info({'id': template['id']}) self.assertNotIn(os_string, template['operating-systems'])
def test_positive_remove_os_by_id(self): """Check if operating system can be removed from a template :id: b5362565-6dce-4770-81e1-4fe3ec6f6cee :expectedresults: Operating system is removed from template :CaseLevel: Integration """ template = make_template() new_os = make_os() Template.add_operatingsystem({ 'id': template['id'], 'operatingsystem-id': new_os['id'], }) template = Template.info({'id': template['id']}) os_string = '{0} {1}.{2}'.format( new_os['name'], new_os['major-version'], new_os['minor-version'] ) self.assertIn(os_string, template['operating-systems']) Template.remove_operatingsystem({ 'id': template['id'], 'operatingsystem-id': new_os['id'] }) template = Template.info({'id': template['id']}) self.assertNotIn(os_string, template['operating-systems'])
def test_positive_remove_os_by_id(self): """Check if operating system can be removed from a template @id: b5362565-6dce-4770-81e1-4fe3ec6f6cee @Assert: Operating system is removed from template @CaseLevel: Integration """ template = make_template() new_os = make_os() Template.add_operatingsystem({ 'id': template['id'], 'operatingsystem-id': new_os['id'], }) template = Template.info({'id': template['id']}) os_string = '{0} {1}.{2}'.format( new_os['name'], new_os['major-version'], new_os['minor-version'] ) self.assertIn(os_string, template['operating-systems']) Template.remove_operatingsystem({ 'id': template['id'], 'operatingsystem-id': new_os['id'] }) template = Template.info({'id': template['id']}) self.assertNotIn(os_string, template['operating-systems'])
def test_positive_add_os_by_id(self): """Check if operating system can be added to a template @Feature: Template - Add Operating System @Assert: Operating system is added to the template """ new_template = make_template() new_os = make_os() Template.add_operatingsystem({"id": new_template["id"], "operatingsystem-id": new_os["id"]}) new_template = Template.info({"id": new_template["id"]}) os_string = "{0} {1}.{2}".format(new_os["name"], new_os["major-version"], new_os["minor-version"]) self.assertIn(os_string, new_template["operating-systems"])
def test_add_operating_system_1(self): """@Test: Check if Template can be assigned operating system @Feature: Template - Add Operating System @Assert: Template has an operating system """ content = gen_string("alpha", 10) name = gen_string("alpha", 10) try: new_template = make_template({ 'name': name, 'content': content, }) new_os = make_os() except CLIFactoryError as err: self.fail(err) result = Template.add_operatingsystem({ "id": new_template["id"], "operatingsystem-id": new_os["id"], }) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) result = Template.info({'id': new_template['id']}) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) os_string = '{0} {1}.{2}'.format( new_os['name'], new_os['major-version'], new_os['minor-version'] ) self.assertIn(os_string, result.stdout['operating-systems'])
def test_positive_remove_os_by_id(self): """Check if operating system can be removed from a template @Feature: Template - Remove Operating System @Assert: Operating system is removed from template """ template = make_template() new_os = make_os() Template.add_operatingsystem({"id": template["id"], "operatingsystem-id": new_os["id"]}) template = Template.info({"id": template["id"]}) os_string = "{0} {1}.{2}".format(new_os["name"], new_os["major-version"], new_os["minor-version"]) self.assertIn(os_string, template["operating-systems"]) Template.remove_operatingsystem({"id": template["id"], "operatingsystem-id": new_os["id"]}) template = Template.info({"id": template["id"]}) self.assertNotIn(os_string, template["operating-systems"])
def test_add_operating_system_1(self): """@Test: Check if Template can be assigned operating system @Feature: Template - Add Operating System @Assert: Template has an operating system """ new_template = make_template() new_os = make_os() Template.add_operatingsystem({ 'id': new_template['id'], 'operatingsystem-id': new_os['id'], }) new_template = Template.info({'id': new_template['id']}) os_string = '{0} {1}.{2}'.format( new_os['name'], new_os['major-version'], new_os['minor-version']) self.assertIn(os_string, new_template['operating-systems'])
def test_positive_add_os_by_id(self): """Check if operating system can be added to a template @Feature: Template - Add Operating System @Assert: Operating system is added to the template """ new_template = make_template() new_os = make_os() Template.add_operatingsystem({ 'id': new_template['id'], 'operatingsystem-id': new_os['id'], }) new_template = Template.info({'id': new_template['id']}) os_string = '{0} {1}.{2}'.format( new_os['name'], new_os['major-version'], new_os['minor-version']) self.assertIn(os_string, new_template['operating-systems'])
def test_positive_add_os_by_id(module_os_with_minor): """Check if operating system can be added to a template :id: d9f481b3-9757-4208-b451-baf4792d4d70 :expectedresults: Operating system is added to the template :CaseLevel: Integration """ new_template = make_template() Template.add_operatingsystem( {'id': new_template['id'], 'operatingsystem-id': module_os_with_minor.id} ) new_template = Template.info({'id': new_template['id']}) os_string = ( f'{module_os_with_minor.name} {module_os_with_minor.major}.{module_os_with_minor.minor}' ) assert os_string in new_template['operating-systems']
def test_positive_add_os_by_id(self): """Check if operating system can be added to a template @Feature: Template - Add Operating System @Assert: Operating system is added to the template """ new_template = make_template() new_os = make_os() Template.add_operatingsystem({ 'id': new_template['id'], 'operatingsystem-id': new_os['id'], }) new_template = Template.info({'id': new_template['id']}) os_string = '{0} {1}.{2}'.format(new_os['name'], new_os['major-version'], new_os['minor-version']) self.assertIn(os_string, new_template['operating-systems'])
def test_remove_operating_system_1(self): """@Test: Check if OS can be removed Template @Feature: Template - Remove Operating System @Assert: Template no longer has an operating system """ content = generate_string("alpha", 10) name = generate_string("alpha", 10) try: new_obj = make_template( { 'name': name, 'content': content, } ) new_os = make_os() except CLIFactoryError as e: self.fail(e) result = Template.add_operatingsystem( { "id": new_obj["id"], "operatingsystem-id": new_os["id"] } ) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) result = Template.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) os_string = "%s %s.%s" % ( new_os['name'], new_os['major'], new_os['minor'] ) self.assertIn(os_string, result.stdout['operating-systems']) result = Template.remove_operatingsystem( { "id": new_obj["id"], "operatingsystem-id": new_os["id"] } ) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) result = Template.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) os_string = "%s %s.%s" % ( new_os['name'], new_os['major'], new_os['minor'] ) self.assertNotIn(os_string, result.stdout['operating-systems'])
def test_positive_add_os_by_id(self): """Check if operating system can be added to a template :id: d9f481b3-9757-4208-b451-baf4792d4d70 :expectedresults: Operating system is added to the template :CaseLevel: Integration """ new_template = make_template() new_os = make_os() Template.add_operatingsystem({ 'id': new_template['id'], 'operatingsystem-id': new_os['id'], }) new_template = Template.info({'id': new_template['id']}) os_string = '{0} {1}.{2}'.format( new_os['name'], new_os['major-version'], new_os['minor-version']) self.assertIn(os_string, new_template['operating-systems'])
def test_positive_add_os_by_id(self): """Check if operating system can be added to a template @id: d9f481b3-9757-4208-b451-baf4792d4d70 @Assert: Operating system is added to the template @CaseLevel: Integration """ new_template = make_template() new_os = make_os() Template.add_operatingsystem({ 'id': new_template['id'], 'operatingsystem-id': new_os['id'], }) new_template = Template.info({'id': new_template['id']}) os_string = '{0} {1}.{2}'.format( new_os['name'], new_os['major-version'], new_os['minor-version']) self.assertIn(os_string, new_template['operating-systems'])
def test_positive_remove_os_by_id(self): """Check if operating system can be removed from a template @Feature: Template - Remove Operating System @Assert: Operating system is removed from template """ template = make_template() new_os = make_os() Template.add_operatingsystem({ 'id': template['id'], 'operatingsystem-id': new_os['id'], }) template = Template.info({'id': template['id']}) os_string = '{0} {1}.{2}'.format(new_os['name'], new_os['major-version'], new_os['minor-version']) self.assertIn(os_string, template['operating-systems']) Template.remove_operatingsystem({ 'id': template['id'], 'operatingsystem-id': new_os['id'] }) template = Template.info({'id': template['id']}) self.assertNotIn(os_string, template['operating-systems'])
def test_positive_remove_os_by_id(self): """Check if operating system can be removed from a template @Feature: Template - Remove Operating System @Assert: Operating system is removed from template """ template = make_template() new_os = make_os() Template.add_operatingsystem({ 'id': template['id'], 'operatingsystem-id': new_os['id'], }) template = Template.info({'id': template['id']}) os_string = '{0} {1}.{2}'.format( new_os['name'], new_os['major-version'], new_os['minor-version'] ) self.assertIn(os_string, template['operating-systems']) Template.remove_operatingsystem({ 'id': template['id'], 'operatingsystem-id': new_os['id'] }) template = Template.info({'id': template['id']}) self.assertNotIn(os_string, template['operating-systems'])
def test_positive_remove_os_by_id(self): """Check if operating system can be removed from a template :id: b5362565-6dce-4770-81e1-4fe3ec6f6cee :expectedresults: Operating system is removed from template :CaseLevel: Integration :CaseImportance: Medium :BZ: 1395229 """ template = make_template() new_os = make_os() Template.add_operatingsystem({'id': template['id'], 'operatingsystem-id': new_os['id']}) template = Template.info({'id': template['id']}) os_string = '{} {}.{}'.format( new_os['name'], new_os['major-version'], new_os['minor-version'] ) self.assertIn(os_string, template['operating-systems']) Template.remove_operatingsystem({'id': template['id'], 'operatingsystem-id': new_os['id']}) template = Template.info({'id': template['id']}) self.assertNotIn(os_string, template['operating-systems'])