halfapi/tests/dummy_domain/routers/config/__init__.py
2022-08-19 18:45:45 +02:00

29 lines
720 B
Python

from halfapi.lib.acl import ACL
from ... import acl
from halfapi.logging import logger
@ACL([
{'acl':acl.public},
{'acl':acl.random},
])
def get(halfapi):
"""
description:
returns the configuration of the domain
"""
logger.error('%s', halfapi)
# TODO: Remove in 0.7.0
try:
assert 'test' in halfapi['config']['domain']['dummy_domain']['config']
except AssertionError as exc:
logger.error('No TEST in halfapi[config][domain][dummy_domain][config]')
raise exc
try:
assert 'test' in halfapi['config']
except AssertionError as exc:
logger.error('No TEST in halfapi[config]')
raise exc
return halfapi['config']