Пример #1
0
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" 
Пример #2
0
 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')
Пример #3
0
 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")
Пример #4
0
 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')
Пример #5
0
 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')
Пример #6
0
 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')
Пример #7
0
 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")
Пример #8
0
 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")
Пример #9
0
 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')
Пример #10
0
 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")
Пример #11
0
 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")
Пример #12
0
 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')
Пример #13
0
 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')
Пример #14
0
 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")
Пример #15
0
 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")
Пример #16
0
 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")
Пример #17
0
 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")
Пример #18
0
 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")
Пример #19
0
 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")
Пример #20
0
 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")
Пример #21
0
 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")
Пример #22
0
 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")
Пример #23
0
 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")
Пример #24
0
 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')
Пример #25
0
 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')
Пример #26
0
 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")
Пример #27
0
 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")
Пример #28
0
 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")
Пример #29
0
 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')
Пример #30
0
 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')
Пример #31
0
 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')
Пример #32
0
 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')        
Пример #33
0
 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')
Пример #34
0
 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')
Пример #35
0
 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')
Пример #36
0
 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')
Пример #37
0
 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')
Пример #38
0
 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')
Пример #39
0
 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')
Пример #40
0
 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')
Пример #41
0
 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")
Пример #42
0
 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')
Пример #43
0
 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")
Пример #44
0
 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")
Пример #45
0
 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")
Пример #46
0
 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")
Пример #47
0
 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')
Пример #48
0
 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')
Пример #49
0
 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')
Пример #50
0
 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')
Пример #51
0
 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")
Пример #52
0
 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')
Пример #53
0
 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')
Пример #54
0
 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')
Пример #55
0
 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')
Пример #56
0
 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')
Пример #57
0
 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')
Пример #58
0
 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')
Пример #59
0
 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')
Пример #60
0
    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')