Ejemplo n.º 1
0
 def test_isMember(self):  # FROM PERSON.py
     r = p.isMember(self.movie, self.person)
     self.assertEqual(r, 'test The Matrix and Keanu Reeves')
Ejemplo n.º 2
0
                movie = f.runtime(movie)
            else:
                print(
                    'IMDBot: Sorry, I need to know which movie you want me to check the runtime for. Please ask me to find a movie first.'
                )

        elif (
            ('worked' in user_input and 'on' in user_input)
                or ('role' in user_input and 'in' in user_input)
                or ('acted' in user_input and 'in' in user_input)
        ):  # Moved to bottom because it can get called by accident if at the top
            #takes in user input and calls isMember() from person.py
            if 'movie' in locals():
                print("IMDBot: Hmm... let me check...")
                p.isMember(
                    movie, person
                )  # Takes movie and person objects so they must already be defined
            else:
                print("IMDBot: Sorry, I could not find anything about that.")

        elif (('plot' in user_input)):
            if 'movie' in locals():
                movie = f.giveSummary(movie)
            else:
                print(
                    'IMDBot: Sorry, I don\'t know which movie you\'re asking about. Try to ask me to find a movie :)'
                )

        elif (('ask' in user_input) or ('question' in user_input)):
            wolframQuestion(userName)
Ejemplo n.º 3
0
     else:
         print(
             'IMDBot: Sorry, I need to know which movie you want me to check the runtime for. Please ask me to find a movie first.'
         )
 elif (user_input.lower().__contains__('change' and 'name')):
     userName = u.checkName(userName)
     print('How can I help you?'
           )  #concatenates to "IMDBot: That's a cool name, userName! "
 elif (user_input.lower().__contains__('nevermind')):
     print(f'IMDBot: Ok. How can I help?')
 elif (user_input.lower().__contains__('worked on')
       or user_input.lower().__contains__('role in')):
     #takes in user input and calls isMember() from person.py
     if 'movie' in locals():
         print("IMDBOT: Hmm... let me check...")
         p.isMember(movie, person)
     else:
         print("IMDBOT: Sorry, I could not find anything about that")
 elif (user_input.lower().__contains__('what other')):
     #takes in user input and calls otherRoles() from person.py
     if 'movie' in locals():
         print("IMDBOT: Hmm... let me think...")
         p.otherRoles(person)
     else:
         print("IMDBOT: Sorry i am not sure how to help with that")
 elif (user_input.lower().__contains__('birthday')
       or user_input.lower().__contains__('birth date')):
     #Call giveBio() from person.py
     #Search for birthday/birthdate
     #"What is the birthday of {any actor name} or birthday/birth date of {any actor name}"
     #Problem with code you have to type birthday/birth date of {any actor name}(as a whole sentence) in order of it to work! Working on the fix ASAP