diff --git a/tests/dummy_domain/acl.py b/tests/dummy_domain/acl.py index 76ecde5..70fea86 100644 --- a/tests/dummy_domain/acl.py +++ b/tests/dummy_domain/acl.py @@ -1 +1,8 @@ +from random import randint + public = lambda *args: True + +random = lambda *args: randint(0,1) == 1 + +denied = lambda *args: False + diff --git a/tests/dummy_domain/routers/config/__init__.py b/tests/dummy_domain/routers/config/__init__.py index 1f0422a..3cf45b0 100644 --- a/tests/dummy_domain/routers/config/__init__.py +++ b/tests/dummy_domain/routers/config/__init__.py @@ -1,8 +1,11 @@ -from halfapi.lib import acl +from ... import acl from halfapi.logging import logger ACLS = { - 'GET' : [{'acl':acl.public}] + 'GET' : [ + {'acl':acl.public}, + {'acl':acl.random}, + ] } def get(halfapi): diff --git a/tests/test_dummy_domain.py b/tests/test_dummy_domain.py new file mode 100644 index 0000000..64a6b2f --- /dev/null +++ b/tests/test_dummy_domain.py @@ -0,0 +1,6 @@ +def test_dummy_domain(): + from . import dummy_domain + from .dummy_domain import acl + assert acl.public() is True + assert isinstance(acl.random(), int) + assert acl.denied() is False