Exemplo n.º 1
0
  def testOverallResults(self):
    results = overall_results(Team.TEST)

    # Overall rankings
    self.assertEqual('Player 3', results.player_votes[0].player.get().name)
    self.assertEqual('Player 4', results.player_votes[1].player.get().name)
    self.assertEqual('Player 7', results.player_votes[2].player.get().name)

    # Per-game votes
    self.assertEqual('Player 3', results.game_votes[0].three.get().name)
    self.assertEqual('Player 4', results.game_votes[0].two.get().name)
    self.assertEqual('Player 7', results.game_votes[0].one.get().name)
    self.assertEqual(4, results.game_votes[0].voters)
Exemplo n.º 2
0
  def testOverallResults(self):
    results = overall_results(Team.TEST)

    # Overall rankings
    self.assertEqual('Player 9', results.player_votes[0].player.get().name)
    self.assertEqual('Player 7', results.player_votes[1].player.get().name)
    self.assertEqual('Player 3', results.player_votes[2].player.get().name)
    self.assertAlmostEqual(2.6, results.player_votes[0].total, places=3)
    self.assertAlmostEqual(2.4, results.player_votes[1].total, places=3)
    self.assertAlmostEqual(1.0, results.player_votes[2].total, places=3)

    # Game 1
    self.assertEqual('Player 7', results.game_votes[0].three.get().name)
    self.assertEqual('Player 9', results.game_votes[0].two.get().name)
    self.assertEqual('Player 3', results.game_votes[0].one.get().name)
    self.assertEqual(1, results.game_votes[0].voters)

    # Game 2
    self.assertEqual('Player 9', results.game_votes[1].three.get().name)
    self.assertEqual('Player 7', results.game_votes[1].two.get().name)
    self.assertEqual('Player 3', results.game_votes[1].one.get().name)
    self.assertEqual(1, results.game_votes[1].voters)
Exemplo n.º 3
0
  def testOverallResults(self):
    results = overall_results(Team.TEST)

    self.assertEqual(0, len(results.player_votes))
    self.assertEqual(0, len(results.game_votes))