예제 #1
0
 def testGetMoviesForActor(self):
     """
     Tests getting films an actor has acted in
     """
     graph = Graph()
     graph.parseFile(TESTFILE)
     graph.get_movies_for_actor("Faye Dunaway")
예제 #2
0
 def testGraphAddActor(self):
     """
     Tests adding actor vertex
     """
     graph = Graph()
     graph.parseFile(TESTFILE)
     graph.add_actor(Actors("Freeman Blah", 80, "BlahBlah"))
예제 #3
0
 def testGraphAddMovie(self):
     """
     Tests adding movie vertex
     """
     graph = Graph()
     graph.parseFile(TESTFILE)
     graph.add_movie(
         Movies("BlahBlah", "1980", "$121,890,708", "Robert Redford"))
예제 #4
0
 def testGraphAddEdge(self):
     """
     Tests adding an edge
     """
     graph = Graph()
     graph.parseFile(TESTFILE)
     tmp_movie = Movies("BlahBlah", "1980", "$121,890,708",
                        "Robert Redford")
     tmp_actor = Actors("Freeman Blah", 80, "BlahBlah")
     graph.add_movie(tmp_movie)
     graph.add_actor(tmp_actor)
     graph.add_edge(Edges(tmp_actor.name, tmp_movie.name, 222759050.0))
예제 #5
0
 def testMovieActors(self):
     """
     Tests finding actors who acted in a given movie
     """
     graph = Graph()
     graph.parseFile(TESTFILE)
     tmp_movie = Movies("BlahBlah", "1980", "$121,890,708",
                        "Robert Redford")
     tmp_actor = Actors("Freeman Blah", 80, "BlahBlah")
     graph.add_movie(tmp_movie)
     graph.add_actor(tmp_actor)
     graph.add_edge(Edges(tmp_actor.name, tmp_movie.name, 222759050.0))
     graph.get_actors_for_movie("The Arrangement")
예제 #6
0
 def testMovieGross(self):
     """
     Tests how much a movie grossed at Box Office
     """
     graph = Graph()
     graph.parseFile(TESTFILE)
     tmp_movie = Movies("BlahBlah", "1980", "$121,890,708",
                        "Robert Redford")
     tmp_actor = Actors("Freeman Blah", 80, "BlahBlah")
     graph.add_movie(tmp_movie)
     graph.add_actor(tmp_actor)
     graph.add_edge(Edges(tmp_actor.name, tmp_movie.name, 222759050.0))
     graph.get_movie_gross("The Thomas Crown Affair")
예제 #7
0
 def testGetMoviesForYear(self):
     """
     Tests getting movies for given year
     """
     graph = Graph()
     graph.parseFile(TESTFILE)
     tmp_movie = Movies("BlahBlah", "1980", "$121,890,708",
                        "Robert Redford")
     tmp_actor = Actors("Freeman Blah", 80, "BlahBlah")
     graph.add_movie(tmp_movie)
     graph.add_actor(tmp_actor)
     graph.add_edge(Edges(tmp_actor.name, tmp_movie.name, 222759050.0))
     graph.get_movies_for_year("1980")
예제 #8
0
 def testOldestActors(self):
     """
     Tests finding oldest X actors
     """
     graph = Graph()
     graph.parseFile(TESTFILE)
     tmp_movie = Movies("BlahBlah", "1980", "$121,890,708",
                        "Robert Redford")
     tmp_actor = Actors("Freeman Blah", 78, "BlahBlah")
     graph.add_movie(tmp_movie)
     graph.add_actor(tmp_actor)
     graph.add_edge(Edges(tmp_actor.name, tmp_movie.name, 222759050.0))
     graph.find_oldest_actors(2)
예제 #9
0
 def testHighestGrossing(self):
     """
     Tests finding highest grossing X actors
     """
     graph = Graph()
     graph.parseFile(TESTFILE)
     tmp_movie = Movies("BlahBlah", "1980", "$121,890,708",
                        "Robert Redford")
     tmp_actor = Actors("Freeman Blah", 80, "BlahBlah")
     graph.add_movie(tmp_movie)
     graph.add_actor(tmp_actor)
     graph.add_edge(Edges(tmp_actor.name, tmp_movie.name, 222759050.0))
     graph.find_highest_grossing_actors(5)
예제 #10
0
 def testGraphExtract(self):
     """
     Tests extraction from Json file and structure of Graph
     """
     graph = Graph()
     graph.parseFile(TESTFILE)
예제 #11
0
        """
        Tests finding oldest X actors
        """
        graph = Graph()
        graph.parseFile(TESTFILE)
        tmp_movie = Movies("BlahBlah", "1980", "$121,890,708",
                           "Robert Redford")
        tmp_actor = Actors("Freeman Blah", 78, "BlahBlah")
        graph.add_movie(tmp_movie)
        graph.add_actor(tmp_actor)
        graph.add_edge(Edges(tmp_actor.name, tmp_movie.name, 222759050.0))
        graph.find_oldest_actors(2)


if __name__ == "__main__":
    #unittest.main()
    graph = Graph()
    graph.parseFile(TESTFILE)
    tmp_movie = Movies("BlahBlah", "1980", "$121,890,708", "Robert Redford")
    tmp_actor = Actors("Freeman Blah", 78, "BlahBlah")
    graph.add_movie(tmp_movie)
    graph.add_actor(tmp_actor)
    graph.add_edge(Edges(tmp_actor.name, tmp_movie.name, 222759050.0))
    graph.get_movies_for_actor("Faye Dunaway")
    graph.get_movies_for_year("1980")
    graph.get_movie_actors_for_year("1980")
    graph.get_actors_for_movie("The Thomas Crown Affair")
    graph.get_movie_gross("The Thomas Crown Affair")
    graph.find_highest_grossing_actors(5)
    graph.find_oldest_actors(2)