コード例 #1
0
def test_evaluate_disadvantage_with_multiple_values_in_scalar_array():
    operator = Disadvantage([13, 5, 17])
    actual = operator.evaluate()

    assert actual == 5
    assert operator.result == 5
    assert actual == operator.result
コード例 #2
0
def test_evaluate_disadvantage_with_multiple_values_in_scalar_array():
    operator = Disadvantage([13, 5, 17])
    actual = operator.evaluate()

    assert actual == 5
    assert operator.result == 5
    assert actual == operator.result
コード例 #3
0
def test_evaluate_disadvantage_with_dice_token_value(mocker):
    mock_random = mocker.patch("dice.tokens.mt_rand")
    mock_random.side_effect = [5, 17]

    dice_token = Dice(sides=20, rolls=2)
    operator = Disadvantage(dice_token)
    actual = operator.evaluate()

    assert actual == 5
    assert operator.result == 5
    assert actual == operator.result
コード例 #4
0
def test_evaluate_disadvantage_with_dice_token_value(mocker):
    mock_random = mocker.patch("dice.tokens.mt_rand")
    mock_random.side_effect = [5, 17]

    dice_token = Dice(sides=20, rolls=2)
    operator = Disadvantage(dice_token)
    actual = operator.evaluate()

    assert actual == 5
    assert operator.result == 5
    assert actual == operator.result