Example #1
0
def test_keep_entry_range_returns_False_if_no_portion_of_input_is_between_the_range_bounds(
        x):
    s = ''.join(map(py23_str, x))
    assume(
        all(not (1 <= int(i) <= 20) for i in re.findall(r'\d+', s)
            if re.match(r'\d+$', i)))
    assert not keep_entry_range(s, [1], [20], int, re.compile(r'\d+'))
Example #2
0
def test_keep_entry_range_returns_True_if_any_portion_of_input_is_between_any_range_bounds(
        x):
    s = ''.join(map(py23_str, x))
    assume(
        any((1 < int(i) < 20) or (88 < int(i) < 90)
            for i in re.findall(r'\d+', s) if re.match(r'\d+$', i)))
    assert keep_entry_range(s, [1, 88], [20, 90], int, re.compile(r'\d+'))
Example #3
0
def test_keep_entry_range_returns_False_if_no_portion_of_input_is_between_the_range_bounds(x):
    s = ''.join(map(py23_str, x))
    assume(all(not (1 <= int(i) <= 20) for i in re.findall(r'\d+', s) if re.match(r'\d+$', i)))
    assert not keep_entry_range(s, [1], [20], int, re.compile(r'\d+'))
Example #4
0
def test_keep_entry_range_returns_False_if_no_portion_of_input_is_between_the_range_bounds_example():
    assert not keep_entry_range('a56b23c89', [1], [20], int, re.compile(r'\d+'))
Example #5
0
def test_keep_entry_range_returns_True_if_any_portion_of_input_is_between_any_range_bounds(x):
    s = ''.join(map(py23_str, x))
    assume(any((1 < int(i) < 20) or (88 < int(i) < 90) for i in re.findall(r'\d+', s) if re.match(r'\d+$', i)))
    assert keep_entry_range(s, [1, 88], [20, 90], int, re.compile(r'\d+'))
Example #6
0
def test_keep_entry_range_returns_True_if_any_portion_of_input_is_between_any_range_bounds_example():
    assert keep_entry_range('a56b23c89', [1, 88], [20, 90], int, re.compile(r'\d+'))
Example #7
0
def test_keep_entry_range(lows, highs, truth):
    assert keep_entry_range("a56b23c89", lows, highs, int,
                            re.compile(r"\d+")) is truth
Example #8
0
def test_keep_entry_range_returns_False_if_no_portion_of_input_is_between_the_range_bounds_example(
):
    assert not keep_entry_range('a56b23c89', [1], [20], int,
                                re.compile(r'\d+'))
Example #9
0
def test_keep_entry_range_returns_True_if_any_portion_of_input_is_between_any_range_bounds_example(
):
    assert keep_entry_range('a56b23c89', [1, 88], [20, 90], int,
                            re.compile(r'\d+'))
Example #10
0
def test_keep_entry_range(lows, highs, truth):
    assert keep_entry_range("a56b23c89", lows, highs, int, re.compile(r"\d+")) is truth
Example #11
0
def test_keep_entry_range_returns_True_if_any_portion_of_input_is_between_the_range_bounds(
):
    assert keep_entry_range('a56b23c89', [0], [100], int, re.compile(r'\d+'))
Example #12
0
def test_keep_entry_range():

    regex = re.compile(r'\d+')
    assert keep_entry_range('a56b23c89', [0], [100], int, regex)
    assert keep_entry_range('a56b23c89', [1, 88], [20, 90], int, regex)
    assert not keep_entry_range('a56b23c89', [1], [20], int, regex)