Exemple #1
0
        print("--> 2 - Agregar persona")
        print("--> 3 - Modificar persona")
        print("--> 4 - Eliminar persona")
        print("--> 5 - Finalizar")
        return int(input("\n Ingrese un numero para seleccionar una opcion: "))


if __name__ == '__main__':
    menu = Menu()
    bucle = True
    while bucle == True:
        opcion = menu.menuPersona()
        if opcion == 1:
            servicePersona = PersonService()
            servicePersona.get_personList()
            servicePersona = None
        if opcion == 2:
            servicePersona = PersonService()
            servicePersona.agregarPersona()
            servicePersona = None
        if opcion == 3:
            servicePersona = PersonService()
            servicePersona.update_person()
            servicePersona = None
        if opcion == 4:
            servicePersona = PersonService()
            servicePersona.delete_person()
            servicePersona = None
        if opcion == 5:
            bucle = False
 def test_agregar(self, nombre, apellido, edad, key):
     persona = Person(nombre, apellido, edad, key)
     service = PersonService()
     service.agregarPersona()
     self.assertEqual(Repository.person[key], persona.__dict__)