def test_ShouldNotWin_Set_IfAvance_Inferior_2(self):
        player1 = Player()
        player2 = Player()
        local_Tennis = Tennis()

        local_Tennis.ActivateTieBreak()

        for i in range(0, 6):
            local_Tennis.WinThePoint(player1, player2)

        for i in range(0, 6):
            local_Tennis.WinThePoint(player2, player1)

        local_Tennis.WinThePoint(player1, player2)

        self.assertEqual(player1.set, 0)
        self.assertEqual(player2.set, 0)
        self.assertEqual(local_Tennis.tieBreakActivated, True)
        self.assertEqual(player1.tieBreakPoint, 7)
        self.assertEqual(player2.tieBreakPoint, 6)
    def test_ShouldSetTieBreakPoint_And_NotSetPoint_After_TieBreak_Activated(
            self):
        player1 = Player()
        player2 = Player()
        local_Tennis = Tennis()

        local_Tennis.ActivateTieBreak()
        local_Tennis.WinThePoint(player1, player2)

        self.assertEqual(player1.tieBreakPoint, 1)
        self.assertEqual(player2.tieBreakPoint, 0)
        self.assertEqual(player1.point, '0')
        self.assertEqual(player2.point, '0')
    def test_ShouldWin_Set_After_7_0_TieBreakPoint(self):
        player1 = Player()
        player2 = Player()
        local_Tennis = Tennis()

        local_Tennis.ActivateTieBreak()

        for i in range(0, 7):
            local_Tennis.WinThePoint(player1, player2)

        self.assertEqual(player1.set, 1)
        self.assertEqual(player2.set, 0)
        self.assertEqual(player1.jeux, 0)
        self.assertEqual(player2.jeux, 0)
        self.assertEqual(local_Tennis.tieBreakActivated, False)
        self.assertEqual(player1.tieBreakPoint, 0)
        self.assertEqual(player2.tieBreakPoint, 0)
Beispiel #4
0
        print("Tennis Masculin")
        print("-----------------------------------")
    else:
        print("-----------------------------------")
        print("Tennis Feminin")
        print("-----------------------------------")

    i = randint(1, 2)

    if (i == z):
        j = j + 1
    else:
        j = 1

    if i == 1:
        tennis.WinThePoint(player1, player2)
        print("Joueur 1 gagne le point | X" + str(j))
        print("-----------------------------------")
    else:
        tennis.WinThePoint(player2, player1)
        print("Joueur 2 gagne le point | X" + str(j))
        print("-----------------------------------")

    z = i

    ShowScore()

    if (tennis.tieBreakActivated == True):
        print("Tie-Break")
        print("-----------------------------------")
        print("joueur 1 : " + str(player1.tieBreakPoint))