def do_movie(self, s): """Jarvis will get movie details for you""" k = s.split(' ', 1) if k[0] == "cast": data = movie.cast(k[1]) for d in data: print_say(d['name'], self) elif k[0] == "director": data = movie.director(k[1]) for d in data: print_say(d['name'], self) elif k[0] == "plot": data = movie.plot(k[1]) print_say(data, self) elif k[0] == "producer": data = movie.producer(k[1]) for d in data: print_say(d['name'], self) elif k[0] == "rating": data = movie.rating(k[1]) print_say(str(data), self) elif k[0] == "year": data = movie.year(k[1]) print_say(str(data), self)
def test_cast(self): d = movie.cast("Interstellar") self.assertEqual(d[0]['name'], "Ellen Burstyn")