def test_error(): with pytest.raises(InvalidPattern): RegexList(['*']) with pytest.raises(InvalidPattern): rules = RegexList() rules.append('**')
def test_append_rex(): rules = RegexList() rules.append(re.compile('^abc$')) assert 'abc' in rules assert 'a' not in rules
def test_append(): rules = RegexList() rules.append('^abc$') assert 'abc' in rules assert 'a' not in rules
def test_number(): rules = RegexList() rules.append('\d*') assert 1 in rules assert 'a' not in rules