[dummy_domain] add tests for dummy_domain acls

This commit is contained in:
Maxime Alves LIRMM@home 2021-11-29 06:09:18 +01:00
parent c27ed3a966
commit 4dae2f3676
3 changed files with 18 additions and 2 deletions

View File

@ -1 +1,8 @@
from random import randint
public = lambda *args: True
random = lambda *args: randint(0,1) == 1
denied = lambda *args: False

View File

@ -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):

View 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