Exemplo n.º 1
0
 def test_movie_grossing(self):
     test_dictionary = helper.Helper().load_structure('test.json')
     graph = g.Graph(test_dictionary)
     answer = 52100000.0
     actual = graph.movie_grossing('the finest hours')
     self.assertEqual(answer, actual, 'movie grossing is wrong')
Exemplo n.º 2
0
 def test_movies_given_year(self):
     test_dictionary = helper.Helper().load_structure('test.json')
     graph = g.Graph(test_dictionary)
     answer = [u'the benefactor']
     actual = graph.movies_given_year(2015)
     self.assertEqual(answer, actual, 'movies given year is wrong')
Exemplo n.º 3
0
 def test_actors_given_year(self):
     test_dictionary = helper.Helper().load_structure('test.json')
     graph = g.Graph(test_dictionary)
     answer = [u'dakota fanning', u'richard gere', u'theo james', u'clarke peters']
     actual = graph.actors_given_year(2015)
     self.assertEqual(answer, actual, 'actors given year is wrong')
Exemplo n.º 4
0
 def test_oldest_x_actors(self):
     test_dictionary = helper.Helper().load_structure('test.json')
     graph = g.Graph(test_dictionary)
     answer = [u'fred willard', u'charles dance', u'jeremy irons']
     actual = graph.oldest_x_actors(3)
     self.assertEqual(answer, actual, 'oldest actors is wrong')
Exemplo n.º 5
0
 def test_calculate_value(self):
     test_dictionary = helper.Helper().load_structure('test.json')
     graph = g.Graph(test_dictionary)
     answer = 56700000.0
     actual = graph.calculate_value('owen wilson')
     self.assertEqual(answer, actual, 'calculate value is wrong')
Exemplo n.º 6
0
 def test_top_x_actors(self):
     test_dictionary = helper.Helper().load_structure('test.json')
     graph = g.Graph(test_dictionary)
     answer = [u'dakota johnson', u'chlo grace moretz', u'owen wilson']
     actual = graph.top_x_actors(3)
     self.assertEqual(answer, actual, 'top actors is wrong')
Exemplo n.º 7
0
 def test_actors_in_movie(self):
     test_dictionary = helper.Helper().load_structure('test.json')
     graph = g.Graph(test_dictionary)
     answer = [u'chris pine', u'casey affleck', u'ben foster', u'holliday grainger', u'john ortiz', u'eric bana']
     actual = graph.actors_in_movie('the finest hours') 
     self.assertEqual(answer, actual, 'actors in movie is wrong')
Exemplo n.º 8
0
 def test_movies_worked_in(self):
     test_dictionary = helper.Helper().load_structure('test.json')
     graph = g.Graph(test_dictionary)
     answer = [u'zoolander 2']
     actual = graph.movies_worked_in('owen wilson')
     self.assertEqual(answer, actual, 'movies actor worked is wrong')