elif ('nevermind' in user_input): print(f'IMDBot: Ok. How can I help?') elif ((sy.findSyns(user_input, 'find') == 0 or sy.findSyns(user_input, 'search') == 0) and ('another' in user_input or sy.findSyns(user_input, 'movie') == 0)): # pick the movie to talk about movie = f.findMovie(userName) 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, userName) 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)):
elif ('nevermind' in user_input): print(f'IMDBot: Ok. How can I help?') elif ((sy.findSyns(user_input, 'find') == 0 or sy.findSyns(user_input, 'search') == 0) and ('another' in user_input or sy.findSyns(user_input, 'movie') == 0)): # pick the movie to talk about movie = f.findMovie(userName) 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)):
def test_findDirector(self): #FROM FILM.py result = f.findDirector(self.movie) result = result['name'] self.assertEqual(result, 'Lana Wachowski')