Пример #1
0
def test_bounded_integer_strategy_only_produces_in_range():
    s = strat.BoundedIntStrategy(1, 10)
    assert not s.could_have_produced(0)
    assert not s.could_have_produced(11)
Пример #2
0
def test_rejects_invalid_ranges():
    with pytest.raises(ValueError):
        strat.BoundedIntStrategy(10, 9)
Пример #3
0
def test_does_not_simplify_outside_range():
    n = 3
    s = strat.BoundedIntStrategy(0, n)
    for t in s.simplify(n):
        assert 0 <= t <= n
Пример #4
0
def define_stragy_for_integer_Range(strategies, descriptor):
    return strat.BoundedIntStrategy(descriptor.start, descriptor.end)