Esempio n. 1
0
def test_fate():
    game = FateGame()
    winner_info = game.determine_winner([
        {'user': user, 'text': bet}
        for user, bet in zip('abc', '123')
    ])
    assert winner_info['user'] in 'abc'
    assert winner_info['bet'] in [1, 2, 3]
Esempio n. 2
0
def test_equal_bets():
    game = FateGame()
    info1 = game.determine_winner([
        {'user': '******', 'text': '50'},
        {'user': '******', 'text': '50'},
        {'user': '******', 'text': '50'},
        {'user': '******', 'text': '50'},
    ])
    assert info1 == {'user': '******', 'bet': 50}
    info2 = game.determine_winner([
        {'user': '******', 'text': '50'},
        {'user': '******', 'text': '50'},
        {'user': '******', 'text': '50'},
        {'user': '******', 'text': '50'},
    ])
    assert info2 == {'user': '******', 'bet': 50}