def test_positive_delete_by_id(self): """Successfully deletes Operating System by its ID @id: a67a7b01-081b-42f8-a9ab-1f41166d649e @assert: Operating System is deleted """ for name in valid_data_list(): with self.subTest(name): os = make_os({'name': name}) OperatingSys.delete({'id': os['id']}) with self.assertRaises(CLIReturnCodeError): OperatingSys.info({'id': os['id']})
def test_positive_delete_by_id(self): """@test: Successfully deletes Operating System by its ID @feature: Operating System @assert: Operating System is deleted """ for name in valid_data_list(): with self.subTest(name): os = make_os({'name': name}) OperatingSys.delete({'id': os['id']}) with self.assertRaises(CLIReturnCodeError): OperatingSys.info({'id': os['id']})
def test_positive_delete_by_id(self, name): """Successfully deletes Operating System by its ID :id: a67a7b01-081b-42f8-a9ab-1f41166d649e :parametrized: yes :expectedresults: Operating System is deleted :CaseImportance: Critical """ os = make_os({'name': name}) OperatingSys.delete({'id': os['id']}) with pytest.raises(CLIReturnCodeError): OperatingSys.info({'id': os['id']})
def test_negative_delete_1(self, test_data): """@test: Not delete Operating System for invalid data @feature: Operating System - Negative Delete @assert: Operating System is not deleted """ # Create a new object using default values new_obj = make_os() result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to create object") self.assertEqual( len(result.stderr), 0, "There should not be an exception here") # The delete method requires the ID which we will not pass result = OperatingSys.delete(test_data) self.assertNotEqual(result.return_code, 0, "Should not delete object") self.assertGreater( len(result.stderr), 0, "Should have gotten an error") # Now make sure that it still exists result = OperatingSys.info({'id': new_obj['id']}) self.assertTrue(result.return_code == 0, "Failed to find object") self.assertEqual(new_obj['id'], result.stdout['id']) self.assertEqual(new_obj['name'], result.stdout['name'])
def test_positive_delete_1(self, test_data): """@test: Successfully deletes Operating System @feature: Operating System - Positive Delete @assert: Operating System is deleted """ # Create a new object passing @test_data to factory method new_obj = make_os(test_data) result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to create object") self.assertEqual( len(result.stderr), 0, "There should not be an exception here") # Now delete it... result = OperatingSys.delete( {'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to delete object") self.assertEqual(len(result.stderr), 0, "Should not get an error.") # ... and make sure it does not exist anymore result = OperatingSys.info({'id': new_obj['id']}) self.assertNotEqual( result.return_code, 0, "Return code should not be zero") self.assertGreater( len(result.stderr), 0, "Should have gotten an error") self.assertEqual(result.stdout, {}, "Should not get any output")
def test_negative_delete_1(self, test_data): """@test: Not delete Operating System for invalid data @feature: Operating System - Negative Delete @assert: Operating System is not deleted """ # Create a new object using default values new_obj = make_os() result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to create object") self.assertEqual(len(result.stderr), 0, "There should not be an exception here") # The delete method requires the ID which we will not pass result = OperatingSys.delete(test_data) self.assertNotEqual(result.return_code, 0, "Should not delete object") self.assertGreater(len(result.stderr), 0, "Should have gotten an error") # Now make sure that it still exists result = OperatingSys.info({'id': new_obj['id']}) self.assertTrue(result.return_code == 0, "Failed to find object") self.assertEqual(new_obj['id'], result.stdout['id']) self.assertEqual(new_obj['name'], result.stdout['name'])
def test_positive_delete_1(self, test_data): """@test: Successfully deletes Operating System @feature: Operating System - Positive Delete @assert: Operating System is deleted """ # Create a new object passing @test_data to factory method new_obj = make_os(test_data) result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to create object") self.assertEqual(len(result.stderr), 0, "There should not be an exception here") # Now delete it... result = OperatingSys.delete({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to delete object") self.assertEqual(len(result.stderr), 0, "Should not get an error.") # ... and make sure it does not exist anymore result = OperatingSys.info({'id': new_obj['id']}) self.assertNotEqual(result.return_code, 0, "Return code should not be zero") self.assertGreater(len(result.stderr), 0, "Should have gotten an error") self.assertEqual(result.stdout, {}, "Should not get any output")
def test_negative_delete_by_id(self): """Delete Operating System using invalid data @id: d29a9c95-1fe3-4a7a-9f7b-127be065856d @assert: Operating System is not deleted """ for test_data in negative_delete_data(): with self.subTest(test_data): os = make_os() # The delete method requires the ID which we will not pass with self.assertRaises(CLIReturnCodeError): OperatingSys.delete(test_data) # Now make sure that it still exists result = OperatingSys.info({'id': os['id']}) self.assertEqual(os['id'], result['id']) self.assertEqual(os['name'], result['name'])
def test_negative_delete_by_id(self): """@test: Delete Operating System using invalid data @feature: Operating System @assert: Operating System is not deleted """ for test_data in NEGATIVE_DELETE_DATA: with self.subTest(test_data): os = make_os() # The delete method requires the ID which we will not pass with self.assertRaises(CLIReturnCodeError): OperatingSys.delete(test_data) # Now make sure that it still exists result = OperatingSys.info({'id': os['id']}) self.assertEqual(os['id'], result['id']) self.assertEqual(os['name'], result['name'])
def test_negative_delete_by_id(self): """Delete Operating System using invalid data @feature: Operating System @assert: Operating System is not deleted """ for test_data in NEGATIVE_DELETE_DATA: with self.subTest(test_data): os = make_os() # The delete method requires the ID which we will not pass with self.assertRaises(CLIReturnCodeError): OperatingSys.delete(test_data) # Now make sure that it still exists result = OperatingSys.info({'id': os['id']}) self.assertEqual(os['id'], result['id']) self.assertEqual(os['name'], result['name'])
def test_negative_delete_by_id(self, test_data): """Delete Operating System using invalid data :id: d29a9c95-1fe3-4a7a-9f7b-127be065856d :parametrized: yes :expectedresults: Operating System is not deleted :CaseImportance: Critical """ os = make_os() # The delete method requires the ID which we will not pass with pytest.raises(CLIReturnCodeError): OperatingSys.delete(test_data) # Now make sure that it still exists result = OperatingSys.info({'id': os['id']}) assert os['id'] == result['id'] assert os['name'] == result['name']
def test_negative_delete_1(self, test_data): """@test: Not delete Operating System for invalid data @feature: Operating System - Negative Delete @assert: Operating System is not deleted """ # Create a new object using default values new_obj = make_os() # The delete method requires the ID which we will not pass result = OperatingSys.delete(test_data) self.assertNotEqual(result.return_code, 0) self.assertGreater(len(result.stderr), 0) # Now make sure that it still exists result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0) self.assertEqual(new_obj['id'], result.stdout['id']) self.assertEqual(new_obj['name'], result.stdout['name'])
def test_positive_delete_1(self, test_data): """@test: Successfully deletes Operating System @feature: Operating System - Positive Delete @assert: Operating System is deleted """ # Create a new object passing @test_data to factory method new_obj = make_os(test_data) # Now delete it... result = OperatingSys.delete( {'id': new_obj['id']}) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) # ... and make sure it does not exist anymore result = OperatingSys.info({'id': new_obj['id']}) self.assertNotEqual(result.return_code, 0) self.assertGreater(len(result.stderr), 0) self.assertEqual(len(result.stdout), 0)