Exemplo n.º 1
0
def test_error():
    with pytest.raises(InvalidPattern):
        RegexList(['*'])

    with pytest.raises(InvalidPattern):
        rules = RegexList()
        rules.append('**')
Exemplo n.º 2
0
def test_append_rex():
    rules = RegexList()
    rules.append(re.compile('^abc$'))
    assert 'abc' in rules
    assert 'a' not in rules
Exemplo n.º 3
0
def test_append():
    rules = RegexList()
    rules.append('^abc$')
    assert 'abc' in rules
    assert 'a' not in rules
Exemplo n.º 4
0
def test_number():
    rules = RegexList()
    rules.append('\d*')
    assert 1 in rules
    assert 'a' not in rules