elif ( sy.findSyns(user_input, 'director') == 0 or sy.findSyns(user_input, 'directed') == 0 ): #find the director of the movie we're talking about and store as object for follow up questions about them if 'movie' in locals( ): # check if a movie object is already saved (a movie is being spoken about) person = f.findDirector(movie) else: print( 'IMDBot: Sorry, I don\'t know which movie you\'re asking about to find the director. Try to ask me to find a movie :)' ) # if a movie is not being currently discussed, tell user it doesn't understand elif (sy.findSyns(user_input, 'character') == 0): if 'movie' in locals(): movie = f.showCharacters(movie) else: print( 'IMDBot: Sorry, I don\'t know which movie you\'re asking about to list the characters. Try to ask me to find a movie first!' ) elif (('who' in user_input) and ('played' in user_input) or ('voiced' in user_input)): if 'movie' in locals(): person = f.whoPlayed(userName, movie, person_name, movie_name) else: person = f.whoPlayed(userName, '', person_name, movie_name) elif (sy.findSyns(user_input, 'change') == 0 and ('name' in user_input or 'username' in user_input)): userName = u.checkName(userName)
def test_showCharacters(self): #FROM FILM.py result1 = f.showCharacters(self.movie) result1 = result1['name'] self.assertEqual(result1, 'Keanu Reeves')