summaryrefslogtreecommitdiff
path: root/reconfigure/tests/configs/ajenti_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'reconfigure/tests/configs/ajenti_tests.py')
-rw-r--r--reconfigure/tests/configs/ajenti_tests.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/reconfigure/tests/configs/ajenti_tests.py b/reconfigure/tests/configs/ajenti_tests.py
new file mode 100644
index 0000000..56a1dc1
--- /dev/null
+++ b/reconfigure/tests/configs/ajenti_tests.py
@@ -0,0 +1,52 @@
+import json
+
+from reconfigure.configs import AjentiConfig
+from base_test import BaseConfigTest
+
+
+class AjentiConfigTest (BaseConfigTest):
+ sources = {
+ None: """{
+ "authentication": false,
+ "bind": {
+ "host": "0.0.0.0",
+ "port": 8000
+ },
+ "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,
+ 'http_binding': {'host': '0.0.0.0', 'port': 8000},
+ 'ssl': {'certificate_path': '', 'enable': False},
+ 'users': {'test': {
+ 'configs': {'a': {'data': {}, 'name': 'a'}},
+ 'name': 'test',
+ 'password': 'sha512',
+ 'permissions': ['section:Dash']
+ }}
+ }
+
+ config = AjentiConfig
+
+ stringify_filter = staticmethod(json.loads)
+
+
+del BaseConfigTest