Add new test to unsafe matches
This commit is contained in:
parent
bb27e3124f
commit
bf672bdec3
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ class TestSafeRe:
|
||||||
)
|
)
|
||||||
assert SafeRe.match(".+/data.json", "data/users/1J3rJ8ecnwH2EPYa6MrgZttBNc61ACFiCj/data.json")
|
assert SafeRe.match(".+/data.json", "data/users/1J3rJ8ecnwH2EPYa6MrgZttBNc61ACFiCj/data.json")
|
||||||
|
|
||||||
@pytest.mark.parametrize("pattern", ["([a-zA-Z]+)*", "(a|aa)+*", "(a|a?)+", "(.*a){10}"])
|
@pytest.mark.parametrize("pattern", ["([a-zA-Z]+)*", "(a|aa)+*", "(a|a?)+", "(.*a){10}", "((?!json).)*$", "(\w+\d+)+C"])
|
||||||
def testUnsafeMatch(self, pattern):
|
def testUnsafeMatch(self, pattern):
|
||||||
with pytest.raises(SafeRe.UnsafePatternError) as err:
|
with pytest.raises(SafeRe.UnsafePatternError) as err:
|
||||||
SafeRe.match(pattern, "aaaaaaaaaaaaaaaaaaaaaaaa!")
|
SafeRe.match(pattern, "aaaaaaaaaaaaaaaaaaaaaaaa!")
|
||||||
|
|
Loading…
Reference in a new issue