1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
import json
from reconfigure.configs import AjentiConfig
from reconfigure.tests.configs.base_test import BaseConfigTest
class AjentiConfigTest (BaseConfigTest):
sources = {
None: """{
"authentication": false,
"bind": {
"host": "0.0.0.0",
"port": 8000
},
"language": null,
"enable_feedback": true,
"installation_id": null,
"users": {
"test": {
"configs": { "a": "{}" },
"password": "sha512",
"permissions": [
"section:Dash"
]
}
},
"ssl": {
"enable": false,
"certificate_path": ""
}
}
"""
}
result = {
'authentication': False,
'enable_feedback': True,
'installation_id': None,
'language': None,
'http_binding': {'host': '0.0.0.0', 'port': 8000},
'ssl': {'certificate_path': '', 'enable': False},
'users': {'test': {
'configs': {'a': {'data': {}, 'name': 'a'}},
'email': None,
'name': 'test',
'password': 'sha512',
'permissions': ['section:Dash']
}}
}
config = AjentiConfig
stringify_filter = staticmethod(lambda x: json.loads(str(x)))
del BaseConfigTest
|