示例#1
0
def test_game_winner():
    p1 = Player()
    p2 = Player()
    game = Game(rng, p1, p2)
    p1.score = 90
    p2.score = 101
    assert game.winner() == p2
示例#2
0
def test_game_winner():
    p1 = Player()
    p2 = Player()
    game = Game(rng, p1, p2)
    p1.score = 90
    p2.score = 101
    assert game.winner() == p2
def test_game_goes_until_there_is_a_winner():
    random.seed()
    p1 = StopAtThreePlayer()
    p2 = TestPlayer()
    game = Game(p1, p2)

    game.start()
    assert game.winner() is not None
示例#4
0
def test_game_goes_until_there_is_a_winner():
    random.seed()
    p1 = StopAtThreePlayer()
    p2 = TestPlayer()

    game = Game(NonRandom(), p1, p2)

    game.start()
    assert game.winner() is p1