Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
with pytest.raises(ValueError):
utilities.is_ecma_regex('/wrong regex')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/gim')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/asdf')
assert utilities.is_ecma_regex('/^some regex\/gim') is True
assert utilities.is_ecma_regex('/^some regex\\\\/trololo') is True
assert utilities.is_ecma_regex('/^some regex\\\\\/gim') is True
assert utilities.is_ecma_regex('/\\\\/') is True
assert utilities.is_ecma_regex('some /regex/asdf') is False
assert utilities.is_ecma_regex('^some regex$//') is False
def test_is_ecma_regex():
assert utilities.is_ecma_regex('some regex') is False
assert utilities.is_ecma_regex('^some regex$') is False
assert utilities.is_ecma_regex('/^some regex$/') is True
assert utilities.is_ecma_regex('/^some regex$/gim') is True
assert utilities.is_ecma_regex('/^some regex$/trololo') is True
with pytest.raises(ValueError):
utilities.is_ecma_regex('/wrong regex')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/gim')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/asdf')
assert utilities.is_ecma_regex('/^some regex\/gim') is True
assert utilities.is_ecma_regex('/^some regex\\\\/trololo') is True
assert utilities.is_ecma_regex('/^some regex\\\\\/gim') is True
assert utilities.is_ecma_regex('/\\\\/') is True
def test_is_ecma_regex():
assert utilities.is_ecma_regex('some regex') is False
assert utilities.is_ecma_regex('^some regex$') is False
assert utilities.is_ecma_regex('/^some regex$/') is True
assert utilities.is_ecma_regex('/^some regex$/gim') is True
assert utilities.is_ecma_regex('/^some regex$/trololo') is True
with pytest.raises(ValueError):
utilities.is_ecma_regex('/wrong regex')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/gim')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/asdf')
assert utilities.is_ecma_regex('/^some regex\/gim') is True
assert utilities.is_ecma_regex('/^some regex\\\\/trololo') is True
assert utilities.is_ecma_regex('/^some regex\\\\\/gim') is True
assert utilities.is_ecma_regex('/\\\\/') is True
def test_is_ecma_regex():
assert utilities.is_ecma_regex('some regex') is False
assert utilities.is_ecma_regex('^some regex$') is False
assert utilities.is_ecma_regex('/^some regex$/') is True
assert utilities.is_ecma_regex('/^some regex$/gim') is True
assert utilities.is_ecma_regex('/^some regex$/trololo') is True
with pytest.raises(ValueError):
utilities.is_ecma_regex('/wrong regex')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/gim')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/asdf')
assert utilities.is_ecma_regex('/^some regex\/gim') is True
assert utilities.is_ecma_regex('/^some regex\\\\/trololo') is True
assert utilities.is_ecma_regex('/^some regex\\\\\/gim') is True
assert utilities.is_ecma_regex('/\\\\/') is True
assert utilities.is_ecma_regex('some /regex/asdf') is False
assert utilities.is_ecma_regex('^some regex$//') is False
assert utilities.is_ecma_regex('some regex') is False
assert utilities.is_ecma_regex('^some regex$') is False
assert utilities.is_ecma_regex('/^some regex$/') is True
assert utilities.is_ecma_regex('/^some regex$/gim') is True
assert utilities.is_ecma_regex('/^some regex$/trololo') is True
with pytest.raises(ValueError):
utilities.is_ecma_regex('/wrong regex')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/gim')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/asdf')
assert utilities.is_ecma_regex('/^some regex\/gim') is True
assert utilities.is_ecma_regex('/^some regex\\\\/trololo') is True
assert utilities.is_ecma_regex('/^some regex\\\\\/gim') is True
assert utilities.is_ecma_regex('/\\\\/') is True
assert utilities.is_ecma_regex('some /regex/asdf') is False
assert utilities.is_ecma_regex('^some regex$//') is False
utilities.is_ecma_regex('/wrong regex')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/gim')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/asdf')
assert utilities.is_ecma_regex('/^some regex\/gim') is True
assert utilities.is_ecma_regex('/^some regex\\\\/trololo') is True
assert utilities.is_ecma_regex('/^some regex\\\\\/gim') is True
assert utilities.is_ecma_regex('/\\\\/') is True
assert utilities.is_ecma_regex('some /regex/asdf') is False
assert utilities.is_ecma_regex('^some regex$//') is False
assert utilities.is_ecma_regex('/^some regex$/gim') is True
assert utilities.is_ecma_regex('/^some regex$/trololo') is True
with pytest.raises(ValueError):
utilities.is_ecma_regex('/wrong regex')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/gim')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/asdf')
assert utilities.is_ecma_regex('/^some regex\/gim') is True
assert utilities.is_ecma_regex('/^some regex\\\\/trololo') is True
assert utilities.is_ecma_regex('/^some regex\\\\\/gim') is True
assert utilities.is_ecma_regex('/\\\\/') is True
assert utilities.is_ecma_regex('some /regex/asdf') is False
assert utilities.is_ecma_regex('^some regex$//') is False
assert utilities.is_ecma_regex('/^some regex$/') is True
assert utilities.is_ecma_regex('/^some regex$/gim') is True
assert utilities.is_ecma_regex('/^some regex$/trololo') is True
with pytest.raises(ValueError):
utilities.is_ecma_regex('/wrong regex')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/gim')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/asdf')
assert utilities.is_ecma_regex('/^some regex\/gim') is True
assert utilities.is_ecma_regex('/^some regex\\\\/trololo') is True
assert utilities.is_ecma_regex('/^some regex\\\\\/gim') is True
assert utilities.is_ecma_regex('/\\\\/') is True
assert utilities.is_ecma_regex('some /regex/asdf') is False
assert utilities.is_ecma_regex('^some regex$//') is False
def test_is_ecma_regex():
assert utilities.is_ecma_regex('some regex') is False
assert utilities.is_ecma_regex('^some regex$') is False
assert utilities.is_ecma_regex('/^some regex$/') is True
assert utilities.is_ecma_regex('/^some regex$/gim') is True
assert utilities.is_ecma_regex('/^some regex$/trololo') is True
with pytest.raises(ValueError):
utilities.is_ecma_regex('/wrong regex')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/gim')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/asdf')
assert utilities.is_ecma_regex('/^some regex\/gim') is True
assert utilities.is_ecma_regex('/^some regex\\\\/trololo') is True
assert utilities.is_ecma_regex('/^some regex\\\\\/gim') is True
assert utilities.is_ecma_regex('/\\\\/') is True
assert utilities.is_ecma_regex('some /regex/asdf') is False
assert utilities.is_ecma_regex('^some regex$//') is False
def test_is_ecma_regex():
assert utilities.is_ecma_regex('some regex') is False
assert utilities.is_ecma_regex('^some regex$') is False
assert utilities.is_ecma_regex('/^some regex$/') is True
assert utilities.is_ecma_regex('/^some regex$/gim') is True
assert utilities.is_ecma_regex('/^some regex$/trololo') is True
with pytest.raises(ValueError):
utilities.is_ecma_regex('/wrong regex')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/gim')
with pytest.raises(ValueError):
utilities.is_ecma_regex('wrong regex/asdf')
assert utilities.is_ecma_regex('/^some regex\/gim') is True