mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-30 10:14:53 +00:00
22 lines
531 B
Python
22 lines
531 B
Python
from gometa.configuration.common import AllowDenyPattern
|
|
|
|
|
|
def test_allow_all():
|
|
pattern = AllowDenyPattern.allow_all()
|
|
assert pattern.allowed("foo.table")
|
|
|
|
|
|
def test_deny_all():
|
|
pattern = AllowDenyPattern(allow=[], deny=[".*"])
|
|
assert not pattern.allowed("foo.table")
|
|
|
|
|
|
def test_single_table():
|
|
pattern = AllowDenyPattern(allow=["foo.mytable"])
|
|
assert pattern.allowed("foo.mytable")
|
|
|
|
|
|
def test_default_deny():
|
|
pattern = AllowDenyPattern(allow=["foo.mytable"])
|
|
assert not pattern.allowed("foo.bar")
|