[dummy_domain] add tests for dummy_domain acls
This commit is contained in:
parent
c27ed3a966
commit
4dae2f3676
@ -1 +1,8 @@
|
||||
from random import randint
|
||||
|
||||
public = lambda *args: True
|
||||
|
||||
random = lambda *args: randint(0,1) == 1
|
||||
|
||||
denied = lambda *args: False
|
||||
|
||||
|
@ -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):
|
||||
|
6
tests/test_dummy_domain.py
Normal file
6
tests/test_dummy_domain.py
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user