def test_positive_delete_1(self, test_data): """@Test: Check if content host can be created and deleted @Feature: Content Hosts @Assert: Content host is created and then deleted """ new_system = make_content_host({ u'name': test_data['name'], u'organization-id': self.NEW_ORG['id'], u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id'] }) # Assert that name matches data passed self.assertEqual(new_system['name'], test_data['name'], "Names don't match") # Delete it result = ContentHost.delete({u'id': new_system['id']}) self.assertEqual(result.return_code, 0, "Content host was not deleted") self.assertEqual(len(result.stderr), 0, "No error was expected") # Fetch it result = ContentHost.info({u'id': new_system['id']}) self.assertNotEqual(result.return_code, 0, "Content host should not be found") self.assertGreater(len(result.stderr), 0, "Expected an error here")
def test_positive_delete_by_name(self): """Check if content host can be created and deleted by passing its name @id: 22f1206c-b712-45e9-8e65-3a0a225d6188 @Assert: Content host is created and then deleted """ for name in valid_hosts_list(): with self.subTest(name): content_host = make_content_host({ u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id'], u'name': name, u'organization-id': self.NEW_ORG['id'], }) ContentHost.delete({u'host': content_host['name']}) with self.assertRaises(CLIReturnCodeError): ContentHost.info({'id': content_host['id']})
def test_positive_delete_by_id(self): """Check if content host can be created and deleted @Feature: Content Hosts @Assert: Content host is created and then deleted """ for name in generate_strings_list(): with self.subTest(name): new_system = make_content_host({ u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id'], u'name': name, u'organization-id': self.NEW_ORG['id'], }) ContentHost.delete({u'id': new_system['id']}) with self.assertRaises(CLIReturnCodeError): ContentHost.info({'id': new_system['id']})
def test_positive_delete_by_id(self): """Check if content host can be created and deleted by passing its ID @id: 1aa55e52-a97e-4c11-aab1-244bd4de0dd3 @Assert: Content host is created and then deleted @BZ: 1328202 """ for name in valid_hosts_list(): with self.subTest(name): content_host = make_content_host({ u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id'], u'name': name, u'organization-id': self.NEW_ORG['id'], }) ContentHost.delete({u'host-id': content_host['id']}) with self.assertRaises(CLIReturnCodeError): ContentHost.info({'id': content_host['id']})
def test_positive_delete_1(self): """@Test: Check if content host can be created and deleted @Feature: Content Hosts @Assert: Content host is created and then deleted """ for name in generate_strings_list(): with self.subTest(name): new_system = make_content_host( { u"content-view-id": self.DEFAULT_CV["id"], u"lifecycle-environment-id": self.LIBRARY["id"], u"name": name, u"organization-id": self.NEW_ORG["id"], } ) ContentHost.delete({u"id": new_system["id"]}) with self.assertRaises(CLIReturnCodeError): ContentHost.info({"id": new_system["id"]})
def test_positive_delete_by_name(self): """Check if content host can be created and deleted by passing its name @id: 22f1206c-b712-45e9-8e65-3a0a225d6188 @Assert: Content host is created and then deleted """ for name in valid_hosts_list(): with self.subTest(name): content_host = make_content_host({ u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id'], u'name': name, u'organization-id': self.NEW_ORG['id'], }) ContentHost.delete({u'host': content_host['name']}) with self.assertRaises(CLIReturnCodeError): ContentHost.info({'id': content_host['id']})
def test_positive_delete_by_id(self): """Check if content host can be created and deleted by passing its ID @id: 1aa55e52-a97e-4c11-aab1-244bd4de0dd3 @Assert: Content host is created and then deleted @BZ: 1328202 """ for name in valid_hosts_list(): with self.subTest(name): content_host = make_content_host({ u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id'], u'name': name, u'organization-id': self.NEW_ORG['id'], }) ContentHost.delete({u'host-id': content_host['id']}) with self.assertRaises(CLIReturnCodeError): ContentHost.info({'id': content_host['id']})
def test_positive_delete_1(self, test_data): """@Test: Check if content host can be created and deleted @Feature: Content Hosts @Assert: Content host is created and then deleted """ new_system = make_content_host({ u'name': test_data['name'], u'organization-id': self.NEW_ORG['id'], u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id']}) # Assert that name matches data passed self.assertEqual( new_system['name'], test_data['name'], "Names don't match" ) # Delete it result = ContentHost.delete({u'id': new_system['id']}) self.assertEqual( result.return_code, 0, "Content host was not deleted") self.assertEqual( len(result.stderr), 0, "No error was expected") # Fetch it result = ContentHost.info({ u'id': new_system['id']}) self.assertNotEqual( result.return_code, 0, "Content host should not be found" ) self.assertGreater( len(result.stderr), 0, "Expected an error here" )