Пример #1
0
 def testTournamentWinnerEagles(self):
     competitions = [["Bulls", "Eagles"], ["Bulls", "Bears"],
                     ["Bears", "Eagles"]]
     results = [0, 0, 0]
     expected_result = "Eagles"
     actual_result = tournament_winner(competitions, results)
     self.assertEqual(actual_result, expected_result)
Пример #2
0
 def testTournamentWinnerJava(self):
     competitions = [["HTML", "Java"], ["Java", "Python"],
                     ["Python", "HTML"]]
     results = [0, 1, 1]
     expected_result = "Java"
     actual_result = tournament_winner(competitions, results)
     self.assertEqual(actual_result, expected_result)
Пример #3
0
 def testTournamentWinnerAlgoMasters(self):
     competitions = [["AlgoMasters", "FrontPage Freebirds"],
                     ["Runtime Terror", "Static Startup"],
                     ["WeC#", "Hypertext Assassins"],
                     ["AlgoMasters", "WeC#"],
                     ["Static Startup", "Hypertext Assassins"],
                     ["Runtime Terror", "FrontPage Freebirds"],
                     ["AlgoMasters", "Runtime Terror"],
                     ["Hypertext Assassins", "FrontPage Freebirds"],
                     ["Static Startup", "WeC#"],
                     ["AlgoMasters", "Static Startup"],
                     ["FrontPage Freebirds", "WeC#"],
                     ["Hypertext Assassins", "Runtime Terror"],
                     ["AlgoMasters", "Hypertext Assassins"],
                     ["WeC#", "Runtime Terror"],
                     ["FrontPage Freebirds", "Static Startup"]]
     results = [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0]
     expected_result = "AlgoMasters"
     actual_result = tournament_winner(competitions, results)
     self.assertEqual(actual_result, expected_result)
Пример #4
0
 def testTournamentWinnerB(self):
     competitions = [["A", "B"]]
     results = [0]
     expected_result = "B"
     actual_result = tournament_winner(competitions, results)
     self.assertEqual(actual_result, expected_result)