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], ), )
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], ), )
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)
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()), )
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]), )
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]), )
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]), )
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], ), )