def test_changeInfo(lstcasting): cast10 = { 'id': '31212432412431412132', 'budget': '0', 'genres': 'Drama|Crime', 'imdb_id': 'tt0094675', 'original_language': 'fi', 'original_title': 'Ariel', 'overview': "Taisto Kasurinen is a Finnish coal miner whose father has just committed suicide and who is framed for a crime he did not commit. In jail, he starts to dream about leaving the country and starting a new life. He escapes from prison but things don't go as planned...", 'popularity': '0.823904', 'production_companies': 'Villealfa Filmproduction Oy', 'production_countries': 'Finland', 'release_date': '21/10/1988', 'revenue': '0', 'runtime': '69', 'spoken_languages': 'suomi', 'status': 'Released', 'tagline': '', 'title': 'Ariel', 'vote_average': '7.1', 'vote_count': '40', 'production_companies_number': '2', 'spoken_languages_number': '2' } slt.changeInfo(lstcasting, 1, cast10) cast = slt.getElement(lstcasting, 1) assert cast10 == cast
def changeInfo (lst, pos, element): """ Reemplaza la información de la lista en la posicion pos, con el elemento element """ if (lst['type']=='ARRAY_LIST'): alt.changeInfo (lst, pos, element) else: slt.changeInfo (lst, pos, element)
def test_changeInfo(lstpeliculas): pelicula10 = { 'book_id': '10', 'book_title': 'Title 10', 'author': 'author 10' } slt.changeInfo(lstpeliculas, 1, pelicula10) pelicula = slt.getElement(lstpeliculas, 1) assert pelicula10 == pelicula
def changeInfo(lst, pos, element): """ Reemplaza la información de la lista en la posicion pos, con el elemento element Args: lst Lista a evaluar pos posición en la que se desea modificar la informacion newInfo Información que será agregada en vez de la existente Return :: None """ if (lst['type'] == 'ARRAY_LIST'): alt.changeInfo(lst, pos, element) else: slt.changeInfo(lst, pos, element)
def changeInfo(lst, pos, element): """ Cambia la informacion contenida en el nodo de la lista que se encuentra en la posicion pos. Args: lst: La lista a examinar pos: la posición de la lista con la información a cambiar newinfo: La nueva información que se debe poner en el nodo de la posición pos Raises: Exception """ try: if (lst['type'] == 'ARRAY_LIST'): alt.changeInfo(lst, pos, element) else: slt.changeInfo(lst, pos, element) except Exception as exp: error.reraise(exp, 'List->changeInfo: ')
def test_changeInfo(lstbooks): book10 = {'book_id': '10', 'book_title': 'Title 10', 'author': 'author 10'} slt.changeInfo(lstbooks, 1, book10) book = slt.getElement(lstbooks, 1) assert book10 == book