Exemple #1
0
 def test_highscore_in_awards(self):
     self.db_api.insert_many(
         query.update(),
         self.update_data,
     )
     self.assertEqual(
         [("Memento", "56")],
         self.db_api.select_one(query.highscores()[2], ),
     )
Exemple #2
0
 def test_highscore_in_earnings(self):
     self.db_api.insert_many(
         query.update(),
         self.update_data,
     )
     self.assertEqual(
         [("Memento", "$23,844,220")],
         self.db_api.select_one(query.highscores()[1], ),
     )
Exemple #3
0
 def highscores(self):
     """Return highest value from columns:\n
     Runtime, Box office earnings, Most awards won,\n
     Most nominations, Most Oscars, Highest IMDB Rating.
     """
     try:
         data = self.db_api.select_many(query.highscores())
         return self.printer.print_highscores(data)
     except ValueError as err:
         return ", ".join(err.args)
Exemple #4
0
 def test_highscores_in_all_categories(self):
     self.db_api.insert_many(query.update(), self.update_data)
     self.assertEqual(
         [
             [("The Godfather", "2h55min")],
             [("Memento", "$23,844,220")],
             [("Memento", "56")],
             [("Memento", "55")],
             [("The Godfather", "3")],
             [("The Shawshank Redemption", "9.3")],
         ],
         self.db_api.select_many(query.highscores()),
     )
Exemple #5
0
 def test_highscore_in_imdb_rating(self):
     self.db_api.insert_many(query.update(), self.update_data)
     self.assertEqual(
         [("The Shawshank Redemption", "9.3")],
         self.db_api.select_one(query.highscores()[5]),
     )
Exemple #6
0
 def test_highscore_in_oscars(self):
     self.db_api.insert_many(query.update(), self.update_data)
     self.assertEqual(
         [("The Godfather", "3")],
         self.db_api.select_one(query.highscores()[4]),
     )
Exemple #7
0
 def test_highscore_in_nominations(self):
     self.db_api.insert_many(query.update(), self.update_data)
     self.assertEqual(
         [("Memento", "55")],
         self.db_api.select_one(query.highscores()[3]),
     )
Exemple #8
0
 def test_highscore_in_runtime(self):
     self.db_api.insert_many(query.update(), self.update_data)
     self.assertEqual(
         [("The Godfather", "2h55min")],
         self.db_api.select_one(query.highscores()[0], ),
     )