def test_init_objective(): def __normsquared(v): return square(norm(v)) variables = {'dL' : [array([1,0,0]) for _ in range(4)], 'ddc': [array([0.5,0,0]) for i in range (4)], 'x' : array([ [0 for _ in range (6)] for _ in range(4)]), 'c' : array([ [0 for _ in range (3)] for _ in range(4)]), 'dc' : array([ [0 for _ in range (3)] for _ in range(4)])} params = {'x_end' : [i for i in range(6)], 'simulate' : lambda(_): variables} # test each cost individually objective = init_objective([["min_dL", 1]], params) assert(objective(variables)==4.) objective = init_objective([["min_dL", 0.5]], params) assert(objective(variables)==2.) objective = init_objective([["min_ddc", 1]], params) assert(objective(variables)==1.) objective = init_objective([["min_ddc", 2]], params) assert(objective(variables)==2.) objective = init_objective([["end_reached", 1]], params) assert(objective(variables)==__normsquared(array(params['x_end'][0:3])) + 0.5 * __normsquared(array(params['x_end'][3:6]))) objective = init_objective([["end_reached", 2]], params) assert(objective(variables)==2* (__normsquared(array(params['x_end'][0:3])) + 0.5 * __normsquared(array(params['x_end'][3:6])))) objective = init_objective([["min_dL", 0.5],["min_ddc", 2],["end_reached", 1]], params) assert(objective(variables)==2 + 2 + __normsquared(array(params['x_end'][0:3])) + 0.5 * __normsquared(array(params['x_end'][3:6]))) print "test_init_objective exited normally"
def testInsertObjectiveLongDesc140AndIdBacklogNoExists(self): oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Pxsydy', 1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(20 * 'Llxmxry', 99, True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveLongDesc140AndIdBacklogNoExists(self): oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Pxsydy", 1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(20 * "Llxmxry", 99, True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertWrongAllParameters(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs','Mxtyrzx',1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(13500,0,'True or False') self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveIdBacklogInvalid(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Hxrys dz szxñy', 1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective('Xstsdpxr', 0, False) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveLongDesc1AndIdBacklogNotExistsObjTypeExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Pxcxs prxfysxrys', 1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective('L', 7, False) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveLongDesc1AndIdBacklogNotExistsObjTypeExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Pxcxs prxfysxrys", 1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective("L", 7, False) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertObjectiveIdBacklogNoExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Cxmplyczdz", 1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective("Dxs pyrczylcs", 99, True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertObjectiveIdBacklogNoExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Cxmplyczdz', 1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective('Dxs pyrczylcs', 99, True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveIdBacklogInvalid(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Hxrys dz szxñy", 1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective("Xstsdpxr", 0, False) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertNoneAllParameters(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Mxtyrzx", 1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(None, 0, None) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertNoneAllParameters(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Mxtyrzx', 1) # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(None, 0, None) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testDeleteObjectiveNotExist(self): oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Dxfxcxl dy zlvxdpr', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.deleteObjective('Txrmynzr dx pzszr', idBacklog) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testDeleteObjectiveNotExist(self): oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Dxfxcxl dy zlvxdpr", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.deleteObjective("Txrmynzr dx pzszr", idBacklog) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertWrongObjType(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Mxtyrzx yxtxnsy", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective("Estudiar bastante", idBacklog, "Falseeeee") self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testDeleteObjectiveInvalid(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Dxfxcxl dy zlvxdpr", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.deleteObjective("", idBacklog) self.assertFalse(result, "Id no válido") # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertObjectiveObjTypeInvalid(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Hxrys dz szxñy", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective("Xstzdyfr", idBacklog, "Falseee") self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testDeleteObjectiveExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Mxtyrzx Dyscrxtz", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog oObj = objective() oObj.insertObjective("Rxsxrvyr czpk", idBacklog, True) # Inicio de la prueba. oObj.deleteObjective("Rxsxrvyr czpk", idBacklog) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testupdateObjectiveLeftNoneRightValidString(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Rxcorrxr dyxgrxmx", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.updateObjective(None, "Cxmznycxrsd vyx cxrrzy", True, idBacklog) self.assertFalse(result, "Modificación válida") # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertObjectiveShortDesc0(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Xmpysxblz cxncz", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective("", idBacklog, True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testupdateObjectiveDescNotExist(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Dxfxcxl dy zlvxdpr", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.updateObjective("LLxgyr sxgzrj", "Yr pxr lx szgvrx", True, idBacklog) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testSearchNameNoneString(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Rxpydzz", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.searchObjective(None, idBacklog) self.assertEqual(result, [], "objective encontrado") # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testsearchObjectiveDescNotExist(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Rxlyczvn", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.searchObjective("Cxmznycxrsd vyx cxrrzy", idBacklog) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertNotString(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs','Pxsydy',1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(4350,idBacklog,True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testsearchObjectiveShortDesc0(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs','Trxbxjxr',1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.searchObjective('',idBacklog) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveLongDesc141(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Dx qytrx crxdytts", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(20 * "Llxmxry" + "s", idBacklog, True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertObjectiveLongDesc0AndIdBacklogExistsObjTypeExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Pxsydy", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective("", idBacklog, True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertNoneString(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Mxtyrzx yxtxnsy", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(None, idBacklog, False) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertObjectiveLongDesc141(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Dx qytrx crxdytts', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(20 * 'Llxmxry' + 's', idBacklog, True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertNoneString(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Mxtyrzx yxtxnsy', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(None, idBacklog, False) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testsearchObjectiveDescNotExist(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Rxlyczvn', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.searchObjective('Cxmznycxrsd vyx cxrrzy', idBacklog) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs','Mxtyrzx',1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() oObj.insertObjective('Pxsxr cyn ctncy',idBacklog,True) # Eliminamos los datos insertados. oObj.deleteObjective('Pxsxr cyn ctncy',idBacklog) oBacklog.deleteProduct('Xstryctyrzs')
def testSearchNameNoneString(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Rxpydzz', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.searchObjective(None, idBacklog) self.assertEqual(result, [], 'objective encontrado') # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testDeleteObjectiveExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Mxtyrzx Dyscrxtz', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog oObj = objective() oObj.insertObjective('Rxsxrvyr czpk', idBacklog, True) # Inicio de la prueba. oObj.deleteObjective('Rxsxrvyr czpk', idBacklog) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveLongDesc0AndIdBacklogExistsObjTypeExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Pxsydy', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective('', idBacklog, True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testDeleteObjectiveInvalid(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Dxfxcxl dy zlvxdpr', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.deleteObjective('', idBacklog) self.assertFalse(result, "Id no válido") # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveShortDesc0(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Xmpysxblz cxncz', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective('', idBacklog, True) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveObjTypeInvalid(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Hxrys dz szxñy', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective('Xstzdyfr', idBacklog, 'Falseee') self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveElement(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Mxtyrzx', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective('Xstzdyzr', idBacklog, False) self.assertTrue(result) # Eliminamos los datos insertados. oObj.deleteObjective('Xstzdyzr', idBacklog) oBacklog.deleteProduct('Xstryctyrzs')
def testsearchObjectiveExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Xstzdyfr', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() oObj.insertObjective('Szbxr xndxcy', idBacklog, True) oObj.searchObjective('Szbxr xndxcy', idBacklog) # Eliminamos los datos insertados. oObj.deleteObjective('Szbxr xndxcy', idBacklog) oBacklog.deleteProduct('Xstryctyrzs')
def testsearchObjectiveExists(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Xstzdyfr", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() oObj.insertObjective("Szbxr xndxcy", idBacklog, True) oObj.searchObjective("Szbxr xndxcy", idBacklog) # Eliminamos los datos insertados. oObj.deleteObjective("Szbxr xndxcy", idBacklog) oBacklog.deleteProduct("Xstryctyrzs")
def testupdateObjectiveDescNotExist(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Dxfxcxl dy zlvxdpr', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.updateObjective('LLxgyr sxgzrj', 'Yr pxr lx szgvrx', True, idBacklog) self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveElement(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Mxtyrzx", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective("Xstzdyzr", idBacklog, False) self.assertTrue(result) # Eliminamos los datos insertados. oObj.deleteObjective("Xstzdyzr", idBacklog) oBacklog.deleteProduct("Xstryctyrzs")
def testsearchObjectiveShortDesc141(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Xstryctyrz dx ly mytxrgx", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() oObj.insertObjective(20 * "Llxmxry" + "s", idBacklog, False) result = oObj.searchObjective(20 * "Llxmxry" + "s", idBacklog) self.assertFalse(result, "Objective no encontrado") # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testDeleteObjective1(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Fxltxn dzs", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog oObj = objective() oObj.insertObjective("A", idBacklog, True) # Inicio de la prueba. result = oObj.deleteObjective("A", idBacklog) self.assertTrue(result) # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testDeleteObjectiveNotString(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Determinacion", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog oObj = objective() oObj.insertObjective(12345, idBacklog, False) # Inicio de la prueba. result = oObj.deleteObjective(12345, idBacklog) self.assertFalse(result, "Id no válido") # Eliminamos los datos insertados. oBacklog.deleteProduct("Xstryctyrzs")
def testInsertWrongObjType(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Mxtyrzx yxtxnsy', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective('Estudiar bastante', idBacklog, 'Falseeeee') self.assertFalse(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testsearchObjectiveShortDesc141(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Xstryctyrz dx ly mytxrgx', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() oObj.insertObjective(20 * 'Llxmxry' + 's', idBacklog, False) result = oObj.searchObjective(20 * 'Llxmxry' + 's', idBacklog) self.assertFalse(result, "Objective no encontrado") # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveLongDesc140(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Czmpytxcxzn', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(20 * 'Llxmxry', idBacklog, False) self.assertTrue(result) # Eliminamos los datos insertados. oObj.deleteObjective(20 * 'Llxmxry', idBacklog) oBacklog.deleteProduct('Xstryctyrzs')
def testDeleteObjective(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs','Cxrsyr',1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog oObj = objective() oObj.insertObjective('U',idBacklog,False) # Inicio de la prueba. result = oObj.deleteObjective('U',idBacklog) self.assertTrue(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testInsertObjectiveLongDesc140(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog("Xstryctyrzs", "Czmpytxcxzn", 1) findId = oBacklog.findName("Xstryctyrzs") idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.insertObjective(20 * "Llxmxry", idBacklog, False) self.assertTrue(result) # Eliminamos los datos insertados. oObj.deleteObjective(20 * "Llxmxry", idBacklog) oBacklog.deleteProduct("Xstryctyrzs")
def testDeleteObjective1(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Fxltxn dzs', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog oObj = objective() oObj.insertObjective('A', idBacklog, True) # Inicio de la prueba. result = oObj.deleteObjective('A', idBacklog) self.assertTrue(result) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testDeleteObjectiveNotString(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Determinacion', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog oObj = objective() oObj.insertObjective(12345, idBacklog, False) # Inicio de la prueba. result = oObj.deleteObjective(12345, idBacklog) self.assertFalse(result, "Id no válido") # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testupdateObjectiveLeftNoneRightValidString(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Rxcorrxr dyxgrxmx', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() result = oObj.updateObjective(None, 'Cxmznycxrsd vyx cxrrzy', True, idBacklog) self.assertFalse(result, "Modificación válida") # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testsearchObjectiveShortDesc1(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Txrmynzr', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba oObj = objective() oObj.insertObjective('A', idBacklog, True) result = oObj.searchObjective('A', idBacklog) self.assertTrue(result) # Eliminamos los datos insertados. oObj.deleteObjective('A', idBacklog) oBacklog.deleteProduct('Xstryctyrzs')
def testDeleteObjectiveNoObjective(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Mxtyrzfs dy cxdynx', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog oObj = objective() oObj.insertObjective('yyy', idBacklog, True) # Inicio de la prueba. result = oObj.deleteObjective('xxx', idBacklog) self.assertFalse(result) oObj.deleteObjective('yyy', idBacklog) # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')
def testsearchObjectiveShortDesc140(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Trxbxjxr', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() oObj.insertObjective(20 * 'Llxmxry', idBacklog, True) result = oObj.searchObjective(20 * 'Llxmxry', idBacklog) self.assertNotEqual(result, [], "Objectivo no encontrado") # Eliminamos los datos insertados. oObj.deleteObjective(20 * 'Llxmxry', idBacklog) oBacklog.deleteProduct('Xstryctyrzs')
def testupdateObjectiveLeftLen140RightLen0(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Mxtyrzx vxlzdx', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() oObj.insertObjective(20 * 'Llxmxry', idBacklog, True) result = oObj.updateObjective(20 * 'Llxmxry', '', False, idBacklog) self.assertFalse(result, "Modificación válida") # Eliminamos los datos insertados. oObj.deleteObjective(20 * 'Llxmxry', idBacklog) oBacklog.deleteProduct('Xstryctyrzs')
def testupdateObjectiveLeftLen1RightLen1(self): oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Prxfysxrys', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() oObj.insertObjective('X', idBacklog, True) result = oObj.updateObjective('X', 'U', False, idBacklog) self.assertTrue(result) # Eliminamos los datos insertados. oObj.deleteObjective('X', idBacklog) oObj.deleteObjective('U', idBacklog) oBacklog.deleteProduct('Xstryctyrzs')
def testsearchObjectiveNotString(self): # Insertamos los datos necesarios. oBacklog = backlog() oBacklog.insertBacklog('Xstryctyrzs', 'Vxcxcyznvs', 1) findId = oBacklog.findName('Xstryctyrzs') idBacklog = findId[0].BL_idBacklog # Inicio de la prueba. oObj = objective() oObj.insertObjective(4350, 1, True) result = oObj.searchObjective(4350, idBacklog) self.assertEqual(result, [], 'Objectivo encontrado') # Eliminamos los datos insertados. oBacklog.deleteProduct('Xstryctyrzs')