From 25cd9e14ea8b3fecf6e869c08445953e7fa602cd Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 14 Feb 2019 21:25:00 +0100 Subject: [PATCH] add tests --- test/__init__.py | 0 test/data/boolean1.dict | 1 + test/data/boolean1.json | 23 +++ test/data/boolean1_frozen.dict | 1 + test/data/boolean1_frozen.json | 28 ++++ test/data/choice1.dict | 1 + test/data/choice1.json | 32 ++++ test/data/choice1_frozen.dict | 1 + test/data/choice1_frozen.json | 37 +++++ test/data/choice1_master_slaves.dict | 1 + test/data/choice1_master_slaves.json | 89 ++++++++++ test/data/choice1_master_slaves_hidden.dict | 1 + test/data/choice1_master_slaves_hidden.json | 94 +++++++++++ test/data/choice1_master_slaves_value.dict | 1 + test/data/choice1_master_slaves_value.json | 99 +++++++++++ test/data/choice1_multi.dict | 1 + test/data/choice1_multi.json | 37 +++++ test/data/choice1_rename.dict | 1 + test/data/choice1_rename.json | 36 ++++ test/data/choice1_requires.dict | 1 + test/data/choice1_requires.json | 72 ++++++++ test/data/date1.dict | 1 + test/data/date1.json | 23 +++ test/data/date1_frozen.dict | 1 + test/data/date1_frozen.json | 28 ++++ test/data/filename1.dict | 1 + test/data/filename1.json | 26 +++ test/data/hostname1.dict | 1 + test/data/hostname1.json | 58 +++++++ test/data/ip1.dict | 1 + test/data/ip1.json | 28 ++++ test/data/ip1_frozen.dict | 1 + test/data/ip1_frozen.json | 33 ++++ test/data/mail1.dict | 1 + test/data/mail1.json | 28 ++++ test/data/number1.dict | 1 + test/data/number1.json | 28 ++++ test/data/number1_frozen.dict | 1 + test/data/number1_frozen.json | 33 ++++ test/data/number1_mod_value.dict | 1 + test/data/number1_mod_value.json | 36 ++++ test/data/number1_value.dict | 1 + test/data/number1_value.json | 36 ++++ test/data/unicode1.dict | 1 + test/data/unicode1.json | 27 +++ test/data/unicode1_frozen.dict | 1 + test/data/unicode1_frozen.json | 32 ++++ test/data/unicode1_mandatory.dict | 1 + test/data/unicode1_mandatory.json | 32 ++++ test/data/unicode1_master_hidden_slaves.dict | 1 + test/data/unicode1_master_hidden_slaves.json | 72 ++++++++ test/data/unicode1_master_slaves.dict | 1 + test/data/unicode1_master_slaves.json | 70 ++++++++ .../unicode1_master_slaves_default_value.dict | 1 + .../unicode1_master_slaves_default_value.json | 94 +++++++++++ test/data/unicode1_master_slaves_hidden.dict | 1 + test/data/unicode1_master_slaves_hidden.json | 94 +++++++++++ ...ode1_master_slaves_hidden_all_default.dict | 1 + ...ode1_master_slaves_hidden_all_default.json | 69 ++++++++ .../unicode1_master_slaves_not_equal.dict | 1 + .../unicode1_master_slaves_not_equal.json | 76 +++++++++ .../data/unicode1_master_slaves_requires.dict | 1 + .../data/unicode1_master_slaves_requires.json | 84 ++++++++++ .../unicode1_master_slaves_requires_all.dict | 1 + .../unicode1_master_slaves_requires_all.json | 90 ++++++++++ ...nicode1_master_slaves_requires_master.dict | 1 + ...nicode1_master_slaves_requires_master.json | 90 ++++++++++ ...unicode1_master_slaves_requires_slave.dict | 1 + ...unicode1_master_slaves_requires_slave.json | 74 +++++++++ ...e1_master_slaves_requires_slave_value.dict | 1 + ...e1_master_slaves_requires_slave_value.json | 96 +++++++++++ ...nicode1_master_slaves_requires_slaves.dict | 1 + ...nicode1_master_slaves_requires_slaves.json | 74 +++++++++ ...unicode1_master_slaves_requires_value.dict | 1 + ...unicode1_master_slaves_requires_value.json | 120 ++++++++++++++ .../data/unicode1_master_slaves_submulti.dict | 1 + .../data/unicode1_master_slaves_submulti.json | 71 ++++++++ test/data/unicode1_master_slaves_value.dict | 1 + test/data/unicode1_master_slaves_value.json | 112 +++++++++++++ test/data/unicode1_mod_value.dict | 1 + test/data/unicode1_mod_value.json | 33 ++++ test/data/unicode1_multi.dict | 1 + test/data/unicode1_multi.json | 33 ++++ test/data/unicode1_multi_hidden.dict | 1 + test/data/unicode1_multi_hidden.json | 35 ++++ test/data/unicode1_multi_mandatory.dict | 1 + test/data/unicode1_multi_mandatory.json | 34 ++++ test/data/unicode1_multi_mod_value.dict | 1 + test/data/unicode1_multi_mod_value.json | 44 +++++ .../unicode1_multi_not_equal_collapse.dict | 1 + .../unicode1_multi_not_equal_collapse.json | 155 ++++++++++++++++++ test/data/unicode1_multi_requires.dict | 1 + test/data/unicode1_multi_requires.json | 57 +++++++ test/data/unicode1_multi_value.dict | 1 + test/data/unicode1_multi_value.json | 43 +++++ test/data/unicode1_not_equal.dict | 1 + test/data/unicode1_not_equal.json | 42 +++++ .../unicode1_optiondescription_requires.dict | 1 + .../unicode1_optiondescription_requires.json | 74 +++++++++ test/data/unicode1_requires.dict | 1 + test/data/unicode1_requires.json | 55 +++++++ test/data/unicode1_simple_callback.dict | 1 + test/data/unicode1_simple_callback.json | 35 ++++ test/data/unicode2.dict | 1 + test/data/unicode2.json | 36 ++++ test/data/unicode2_copy.dict | 1 + test/data/unicode2_copy.json | 40 +++++ test/data/unicode2_multi_copy.dict | 1 + test/data/unicode2_multi_copy.json | 51 ++++++ test/data/unicode_hidden.dict | 1 + test/data/unicode_hidden.json | 33 ++++ test/data/unicode_property.dict | 1 + test/data/unicode_property.json | 34 ++++ .../unicode_property_optiondescription.dict | 1 + .../unicode_property_optiondescription.json | 34 ++++ test/data/username1.dict | 1 + test/data/username1.json | 28 ++++ test/data/username1_frozen.dict | 1 + test/data/username1_frozen.json | 33 ++++ test/test_json.py | 37 +++++ tiramisu_json_api/api.py | 11 +- 121 files changed, 3311 insertions(+), 6 deletions(-) create mode 100644 test/__init__.py create mode 100644 test/data/boolean1.dict create mode 100644 test/data/boolean1.json create mode 100644 test/data/boolean1_frozen.dict create mode 100644 test/data/boolean1_frozen.json create mode 100644 test/data/choice1.dict create mode 100644 test/data/choice1.json create mode 100644 test/data/choice1_frozen.dict create mode 100644 test/data/choice1_frozen.json create mode 100644 test/data/choice1_master_slaves.dict create mode 100644 test/data/choice1_master_slaves.json create mode 100644 test/data/choice1_master_slaves_hidden.dict create mode 100644 test/data/choice1_master_slaves_hidden.json create mode 100644 test/data/choice1_master_slaves_value.dict create mode 100644 test/data/choice1_master_slaves_value.json create mode 100644 test/data/choice1_multi.dict create mode 100644 test/data/choice1_multi.json create mode 100644 test/data/choice1_rename.dict create mode 100644 test/data/choice1_rename.json create mode 100644 test/data/choice1_requires.dict create mode 100644 test/data/choice1_requires.json create mode 100644 test/data/date1.dict create mode 100644 test/data/date1.json create mode 100644 test/data/date1_frozen.dict create mode 100644 test/data/date1_frozen.json create mode 100644 test/data/filename1.dict create mode 100644 test/data/filename1.json create mode 100644 test/data/hostname1.dict create mode 100644 test/data/hostname1.json create mode 100644 test/data/ip1.dict create mode 100644 test/data/ip1.json create mode 100644 test/data/ip1_frozen.dict create mode 100644 test/data/ip1_frozen.json create mode 100644 test/data/mail1.dict create mode 100644 test/data/mail1.json create mode 100644 test/data/number1.dict create mode 100644 test/data/number1.json create mode 100644 test/data/number1_frozen.dict create mode 100644 test/data/number1_frozen.json create mode 100644 test/data/number1_mod_value.dict create mode 100644 test/data/number1_mod_value.json create mode 100644 test/data/number1_value.dict create mode 100644 test/data/number1_value.json create mode 100644 test/data/unicode1.dict create mode 100644 test/data/unicode1.json create mode 100644 test/data/unicode1_frozen.dict create mode 100644 test/data/unicode1_frozen.json create mode 100644 test/data/unicode1_mandatory.dict create mode 100644 test/data/unicode1_mandatory.json create mode 100644 test/data/unicode1_master_hidden_slaves.dict create mode 100644 test/data/unicode1_master_hidden_slaves.json create mode 100644 test/data/unicode1_master_slaves.dict create mode 100644 test/data/unicode1_master_slaves.json create mode 100644 test/data/unicode1_master_slaves_default_value.dict create mode 100644 test/data/unicode1_master_slaves_default_value.json create mode 100644 test/data/unicode1_master_slaves_hidden.dict create mode 100644 test/data/unicode1_master_slaves_hidden.json create mode 100644 test/data/unicode1_master_slaves_hidden_all_default.dict create mode 100644 test/data/unicode1_master_slaves_hidden_all_default.json create mode 100644 test/data/unicode1_master_slaves_not_equal.dict create mode 100644 test/data/unicode1_master_slaves_not_equal.json create mode 100644 test/data/unicode1_master_slaves_requires.dict create mode 100644 test/data/unicode1_master_slaves_requires.json create mode 100644 test/data/unicode1_master_slaves_requires_all.dict create mode 100644 test/data/unicode1_master_slaves_requires_all.json create mode 100644 test/data/unicode1_master_slaves_requires_master.dict create mode 100644 test/data/unicode1_master_slaves_requires_master.json create mode 100644 test/data/unicode1_master_slaves_requires_slave.dict create mode 100644 test/data/unicode1_master_slaves_requires_slave.json create mode 100644 test/data/unicode1_master_slaves_requires_slave_value.dict create mode 100644 test/data/unicode1_master_slaves_requires_slave_value.json create mode 100644 test/data/unicode1_master_slaves_requires_slaves.dict create mode 100644 test/data/unicode1_master_slaves_requires_slaves.json create mode 100644 test/data/unicode1_master_slaves_requires_value.dict create mode 100644 test/data/unicode1_master_slaves_requires_value.json create mode 100644 test/data/unicode1_master_slaves_submulti.dict create mode 100644 test/data/unicode1_master_slaves_submulti.json create mode 100644 test/data/unicode1_master_slaves_value.dict create mode 100644 test/data/unicode1_master_slaves_value.json create mode 100644 test/data/unicode1_mod_value.dict create mode 100644 test/data/unicode1_mod_value.json create mode 100644 test/data/unicode1_multi.dict create mode 100644 test/data/unicode1_multi.json create mode 100644 test/data/unicode1_multi_hidden.dict create mode 100644 test/data/unicode1_multi_hidden.json create mode 100644 test/data/unicode1_multi_mandatory.dict create mode 100644 test/data/unicode1_multi_mandatory.json create mode 100644 test/data/unicode1_multi_mod_value.dict create mode 100644 test/data/unicode1_multi_mod_value.json create mode 100644 test/data/unicode1_multi_not_equal_collapse.dict create mode 100644 test/data/unicode1_multi_not_equal_collapse.json create mode 100644 test/data/unicode1_multi_requires.dict create mode 100644 test/data/unicode1_multi_requires.json create mode 100644 test/data/unicode1_multi_value.dict create mode 100644 test/data/unicode1_multi_value.json create mode 100644 test/data/unicode1_not_equal.dict create mode 100644 test/data/unicode1_not_equal.json create mode 100644 test/data/unicode1_optiondescription_requires.dict create mode 100644 test/data/unicode1_optiondescription_requires.json create mode 100644 test/data/unicode1_requires.dict create mode 100644 test/data/unicode1_requires.json create mode 100644 test/data/unicode1_simple_callback.dict create mode 100644 test/data/unicode1_simple_callback.json create mode 100644 test/data/unicode2.dict create mode 100644 test/data/unicode2.json create mode 100644 test/data/unicode2_copy.dict create mode 100644 test/data/unicode2_copy.json create mode 100644 test/data/unicode2_multi_copy.dict create mode 100644 test/data/unicode2_multi_copy.json create mode 100644 test/data/unicode_hidden.dict create mode 100644 test/data/unicode_hidden.json create mode 100644 test/data/unicode_property.dict create mode 100644 test/data/unicode_property.json create mode 100644 test/data/unicode_property_optiondescription.dict create mode 100644 test/data/unicode_property_optiondescription.json create mode 100644 test/data/username1.dict create mode 100644 test/data/username1.json create mode 100644 test/data/username1_frozen.dict create mode 100644 test/data/username1_frozen.json create mode 100644 test/test_json.py diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test/data/boolean1.dict b/test/data/boolean1.dict new file mode 100644 index 0000000..86105f4 --- /dev/null +++ b/test/data/boolean1.dict @@ -0,0 +1 @@ +{"options.boolean": null} \ No newline at end of file diff --git a/test/data/boolean1.json b/test/data/boolean1.json new file mode 100644 index 0000000..0d57bc9 --- /dev/null +++ b/test/data/boolean1.json @@ -0,0 +1,23 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.boolean": { + "name": "options.boolean", + "title": "Boolean 1", + "type": "boolean" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/boolean1_frozen.dict b/test/data/boolean1_frozen.dict new file mode 100644 index 0000000..86105f4 --- /dev/null +++ b/test/data/boolean1_frozen.dict @@ -0,0 +1 @@ +{"options.boolean": null} \ No newline at end of file diff --git a/test/data/boolean1_frozen.json b/test/data/boolean1_frozen.json new file mode 100644 index 0000000..adb2c0f --- /dev/null +++ b/test/data/boolean1_frozen.json @@ -0,0 +1,28 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.boolean": { + "name": "options.boolean", + "type": "boolean", + "title": "Boolean 1 frozen" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.boolean", + "readOnly": true + } + ], + "form": [ + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/choice1.dict b/test/data/choice1.dict new file mode 100644 index 0000000..184d37b --- /dev/null +++ b/test/data/choice1.dict @@ -0,0 +1 @@ +{"options.choice": null} \ No newline at end of file diff --git a/test/data/choice1.json b/test/data/choice1.json new file mode 100644 index 0000000..9907831 --- /dev/null +++ b/test/data/choice1.json @@ -0,0 +1,32 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.choice": { + "name": "options.choice", + "title": "Choice description", + "type": "choice", + "enum": [ + "", + "choice 1", + "choice 2" + ] + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "type": "choice", + "key": "options.choice" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/choice1_frozen.dict b/test/data/choice1_frozen.dict new file mode 100644 index 0000000..184d37b --- /dev/null +++ b/test/data/choice1_frozen.dict @@ -0,0 +1 @@ +{"options.choice": null} \ No newline at end of file diff --git a/test/data/choice1_frozen.json b/test/data/choice1_frozen.json new file mode 100644 index 0000000..f91a82a --- /dev/null +++ b/test/data/choice1_frozen.json @@ -0,0 +1,37 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.choice": { + "name": "options.choice", + "type": "choice", + "enum": [ + "", + "choice 1", + "choice 2" + ], + "title": "Choice description frozen" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.choice", + "readOnly": true + } + ], + "form": [ + { + "key": "options.choice", + "type": "choice" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/choice1_master_slaves.dict b/test/data/choice1_master_slaves.dict new file mode 100644 index 0000000..0738cf9 --- /dev/null +++ b/test/data/choice1_master_slaves.dict @@ -0,0 +1 @@ +{"options.choice1.choice1": [], "options.choice1.choice2": [], "options.choice1.choice3": [], "options.choice1.choice4": []} \ No newline at end of file diff --git a/test/data/choice1_master_slaves.json b/test/data/choice1_master_slaves.json new file mode 100644 index 0000000..17ac8f8 --- /dev/null +++ b/test/data/choice1_master_slaves.json @@ -0,0 +1,89 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.choice1": { + "name": "options.choice1", + "properties": { + "options.choice1.choice1": { + "name": "options.choice1.choice1", + "title": "Choice description master", + "type": "choice", + "isMulti": true, + "enum": [ + "choice 1", + "choice 2" + ] + }, + "options.choice1.choice2": { + "name": "options.choice1.choice2", + "title": "Choice description slave 1", + "type": "choice", + "isMulti": true, + "enum": [ + "", + "choice 3", + "choice 4" + ] + }, + "options.choice1.choice3": { + "name": "options.choice1.choice3", + "title": "Choice description slave 2", + "type": "choice", + "isMulti": true, + "enum": [ + "", + "choice 5", + "choice 6" + ] + }, + "options.choice1.choice4": { + "name": "options.choice1.choice4", + "title": "Choice description slave 3", + "type": "choice", + "isMulti": true, + "enum": [ + "", + "choice 7", + "choice 8" + ] + } + }, + "type": "array", + "title": "Common configuration 1" + } + }, + "type": "object", + "title": "Common configuration 2" + } + }, + "model": [ + { + "key": "options.choice1.choice1", + "required": true + } + ], + "form": [ + { + "type": "choice", + "key": "options.choice1.choice1" + }, + { + "type": "choice", + "key": "options.choice1.choice2" + }, + { + "type": "choice", + "key": "options.choice1.choice3" + }, + { + "type": "choice", + "key": "options.choice1.choice4" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/choice1_master_slaves_hidden.dict b/test/data/choice1_master_slaves_hidden.dict new file mode 100644 index 0000000..fdb7c10 --- /dev/null +++ b/test/data/choice1_master_slaves_hidden.dict @@ -0,0 +1 @@ +{"options.choice1.choice1": [], "options.choice1.choice2": [], "options.choice1.choice4": []} \ No newline at end of file diff --git a/test/data/choice1_master_slaves_hidden.json b/test/data/choice1_master_slaves_hidden.json new file mode 100644 index 0000000..befd56c --- /dev/null +++ b/test/data/choice1_master_slaves_hidden.json @@ -0,0 +1,94 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.choice1": { + "name": "options.choice1", + "properties": { + "options.choice1.choice1": { + "name": "options.choice1.choice1", + "title": "Choice description master", + "type": "choice", + "isMulti": true, + "enum": [ + "choice 1", + "choice 2" + ] + }, + "options.choice1.choice2": { + "name": "options.choice1.choice2", + "title": "Choice description slave 1", + "type": "choice", + "isMulti": true, + "enum": [ + "", + "choice 3", + "choice 4" + ] + }, + "options.choice1.choice3": { + "name": "options.choice1.choice3", + "title": "Choice description slave 2 hidden", + "type": "choice", + "isMulti": true, + "enum": [ + "", + "choice 5", + "choice 6" + ] + }, + "options.choice1.choice4": { + "name": "options.choice1.choice4", + "title": "Choice description slave 3", + "type": "choice", + "isMulti": true, + "enum": [ + "", + "choice 7", + "choice 8" + ] + } + }, + "type": "array", + "title": "Slave 2 is hidden" + } + }, + "type": "object", + "title": "Common configuration 2" + } + }, + "model": [ + { + "key": "options.choice1.choice1", + "required": true + }, + { + "key": "options.choice1.choice3", + "hidden": true, + "display": false + } + ], + "form": [ + { + "type": "choice", + "key": "options.choice1.choice1" + }, + { + "type": "choice", + "key": "options.choice1.choice2" + }, + { + "type": "choice", + "key": "options.choice1.choice3" + }, + { + "type": "choice", + "key": "options.choice1.choice4" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/choice1_master_slaves_value.dict b/test/data/choice1_master_slaves_value.dict new file mode 100644 index 0000000..26cc161 --- /dev/null +++ b/test/data/choice1_master_slaves_value.dict @@ -0,0 +1 @@ +{"options.choice1.choice1": ["choice 2"], "options.choice1.choice2": ["choice 4"], "options.choice1.choice3": [null], "options.choice1.choice4": [null]} \ No newline at end of file diff --git a/test/data/choice1_master_slaves_value.json b/test/data/choice1_master_slaves_value.json new file mode 100644 index 0000000..6778011 --- /dev/null +++ b/test/data/choice1_master_slaves_value.json @@ -0,0 +1,99 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.choice1": { + "name": "options.choice1", + "properties": { + "options.choice1.choice1": { + "name": "options.choice1.choice1", + "title": "Choice master", + "type": "choice", + "isMulti": true, + "enum": [ + "choice 1", + "choice 2" + ] + }, + "options.choice1.choice2": { + "name": "options.choice1.choice2", + "title": "Choice slave 1", + "type": "choice", + "isMulti": true, + "enum": [ + "", + "choice 3", + "choice 4" + ] + }, + "options.choice1.choice3": { + "name": "options.choice1.choice3", + "title": "Choice slave 2", + "type": "choice", + "isMulti": true, + "enum": [ + "", + "choice 5", + "choice 6" + ] + }, + "options.choice1.choice4": { + "name": "options.choice1.choice4", + "title": "Choice slave 3", + "type": "choice", + "isMulti": true, + "enum": [ + "", + "choice 7", + "choice 8" + ] + } + }, + "type": "array", + "title": "Common configuration 1" + } + }, + "type": "object", + "title": "Common configuration 2" + } + }, + "model": [ + { + "key": "options.choice1.choice1", + "required": true, + "value": [ + "choice 2" + ], + "owner": "user" + }, + { + "key": "options.choice1.choice2", + "index": 0, + "value": "choice 4", + "owner": "user" + } + ], + "form": [ + { + "type": "choice", + "key": "options.choice1.choice1" + }, + { + "type": "choice", + "key": "options.choice1.choice2" + }, + { + "type": "choice", + "key": "options.choice1.choice3" + }, + { + "type": "choice", + "key": "options.choice1.choice4" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/choice1_multi.dict b/test/data/choice1_multi.dict new file mode 100644 index 0000000..0743b81 --- /dev/null +++ b/test/data/choice1_multi.dict @@ -0,0 +1 @@ +{"options.choice": []} \ No newline at end of file diff --git a/test/data/choice1_multi.json b/test/data/choice1_multi.json new file mode 100644 index 0000000..e35a172 --- /dev/null +++ b/test/data/choice1_multi.json @@ -0,0 +1,37 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.choice": { + "name": "options.choice", + "title": "Choice description", + "type": "choice", + "isMulti": true, + "enum": [ + "choice 1", + "choice 2" + ] + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.choice", + "required": true + } + ], + "form": [ + { + "type": "choice", + "key": "options.choice" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/choice1_rename.dict b/test/data/choice1_rename.dict new file mode 100644 index 0000000..184d37b --- /dev/null +++ b/test/data/choice1_rename.dict @@ -0,0 +1 @@ +{"options.choice": null} \ No newline at end of file diff --git a/test/data/choice1_rename.json b/test/data/choice1_rename.json new file mode 100644 index 0000000..29c90df --- /dev/null +++ b/test/data/choice1_rename.json @@ -0,0 +1,36 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.choice": { + "name": "options.choice", + "title": "Choice description", + "type": "choice", + "enum": [ + "", + "choice 1", + "choice 2" + ] + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "type": "choice", + "key": "options.choice", + "displayed": { + "choice 1": "renamed 1", + "choice 2": "renamed 2" + } + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/choice1_requires.dict b/test/data/choice1_requires.dict new file mode 100644 index 0000000..77c53e2 --- /dev/null +++ b/test/data/choice1_requires.dict @@ -0,0 +1 @@ +{"options.choice": "hide"} \ No newline at end of file diff --git a/test/data/choice1_requires.json b/test/data/choice1_requires.json new file mode 100644 index 0000000..384ef8b --- /dev/null +++ b/test/data/choice1_requires.json @@ -0,0 +1,72 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.choice": { + "name": "options.choice", + "type": "choice", + "value": "hide", + "enum": [ + "hide", + "show" + ], + "title": "Choice description" + }, + "options.unicode2": { + "name": "options.unicode2", + "type": "string", + "title": "Unicode 2" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.choice", + "required": true, + "value": "hide", + "owner": "default" + }, + { + "key": "options.unicode2", + "hidden": true + } + ], + "form": [ + { + "key": "options.choice", + "clearable": true, + "type": "choice", + "dependencies": { + "default": { + "show": [ + "options.unicode2" + ] + }, + "expected": { + "hide": { + "hide": [ + "options.unicode2" + ] + }, + "show": { + "show": [ + "options.unicode2" + ] + } + } + } + }, + { + "key": "options.unicode2", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/date1.dict b/test/data/date1.dict new file mode 100644 index 0000000..c1fa030 --- /dev/null +++ b/test/data/date1.dict @@ -0,0 +1 @@ +{"options.date": null} \ No newline at end of file diff --git a/test/data/date1.json b/test/data/date1.json new file mode 100644 index 0000000..18d914a --- /dev/null +++ b/test/data/date1.json @@ -0,0 +1,23 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.date": { + "name": "options.date", + "title": "Date description", + "type": "date" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/date1_frozen.dict b/test/data/date1_frozen.dict new file mode 100644 index 0000000..c1fa030 --- /dev/null +++ b/test/data/date1_frozen.dict @@ -0,0 +1 @@ +{"options.date": null} \ No newline at end of file diff --git a/test/data/date1_frozen.json b/test/data/date1_frozen.json new file mode 100644 index 0000000..6042b24 --- /dev/null +++ b/test/data/date1_frozen.json @@ -0,0 +1,28 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.date": { + "name": "options.date", + "type": "date", + "title": "Date description frozen" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.date", + "readOnly": true + } + ], + "form": [ + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/filename1.dict b/test/data/filename1.dict new file mode 100644 index 0000000..12e918c --- /dev/null +++ b/test/data/filename1.dict @@ -0,0 +1 @@ +{"usbpath": null} \ No newline at end of file diff --git a/test/data/filename1.json b/test/data/filename1.json new file mode 100644 index 0000000..3f39d7a --- /dev/null +++ b/test/data/filename1.json @@ -0,0 +1,26 @@ +{ + "schema": { + "usbpath": { + "name": "usbpath", + "title": "Chemin d'acc\u00e8s", + "type": "string" + } + }, + "model": [ + { + "key": "usbpath", + "required": true + } + ], + "form": [ + { + "type": "input", + "pattern": "^[a-zA-Z0-9\\-\\._~/+]+$", + "key": "usbpath" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/hostname1.dict b/test/data/hostname1.dict new file mode 100644 index 0000000..b201d20 --- /dev/null +++ b/test/data/hostname1.dict @@ -0,0 +1 @@ +{"options.hostname1": null, "options.hostname2": null, "options.hostname3": null, "options.hostname4": null} \ No newline at end of file diff --git a/test/data/hostname1.json b/test/data/hostname1.json new file mode 100644 index 0000000..f3fe0f2 --- /dev/null +++ b/test/data/hostname1.json @@ -0,0 +1,58 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.hostname1": { + "name": "options.hostname1", + "title": "Domainname Description", + "type": "domain" + }, + "options.hostname2": { + "name": "options.hostname2", + "title": "Domainname without dot Description", + "type": "domain" + }, + "options.hostname3": { + "name": "options.hostname3", + "title": "Hostname or IP Description", + "type": "domain" + }, + "options.hostname4": { + "name": "options.hostname4", + "title": "Netbios Description", + "type": "domain" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "type": "input", + "pattern": "^((?!-)[a-z0-9-]{1,63}\\.){1,}[a-z0-9-]{1,63}$", + "key": "options.hostname1" + }, + { + "type": "input", + "pattern": "^((?!-)[a-z0-9-]{0,63}\\.){0,}[a-z0-9-]{1,63}$", + "key": "options.hostname2" + }, + { + "type": "input", + "pattern": "^(?:((?!-)[a-z0-9-]{1,63})|(?:(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)))$", + "key": "options.hostname3" + }, + { + "type": "input", + "pattern": "^((?!-)[a-z0-9-]{1,15})$", + "key": "options.hostname4" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/ip1.dict b/test/data/ip1.dict new file mode 100644 index 0000000..43b4866 --- /dev/null +++ b/test/data/ip1.dict @@ -0,0 +1 @@ +{"options.ip": null} \ No newline at end of file diff --git a/test/data/ip1.json b/test/data/ip1.json new file mode 100644 index 0000000..00c50b0 --- /dev/null +++ b/test/data/ip1.json @@ -0,0 +1,28 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.ip": { + "name": "options.ip", + "title": "IP Description", + "type": "string" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "type": "input", + "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$", + "key": "options.ip" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/ip1_frozen.dict b/test/data/ip1_frozen.dict new file mode 100644 index 0000000..43b4866 --- /dev/null +++ b/test/data/ip1_frozen.dict @@ -0,0 +1 @@ +{"options.ip": null} \ No newline at end of file diff --git a/test/data/ip1_frozen.json b/test/data/ip1_frozen.json new file mode 100644 index 0000000..fc14cc0 --- /dev/null +++ b/test/data/ip1_frozen.json @@ -0,0 +1,33 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.ip": { + "name": "options.ip", + "type": "string", + "title": "IP Description frozen" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.ip", + "readOnly": true + } + ], + "form": [ + { + "key": "options.ip", + "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/mail1.dict b/test/data/mail1.dict new file mode 100644 index 0000000..ab12fac --- /dev/null +++ b/test/data/mail1.dict @@ -0,0 +1 @@ +{"options.mail": null} \ No newline at end of file diff --git a/test/data/mail1.json b/test/data/mail1.json new file mode 100644 index 0000000..210dfce --- /dev/null +++ b/test/data/mail1.json @@ -0,0 +1,28 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.mail": { + "name": "options.mail", + "title": "Mail Description", + "type": "string" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "type": "input", + "pattern": "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$", + "key": "options.mail" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/number1.dict b/test/data/number1.dict new file mode 100644 index 0000000..0fe21fa --- /dev/null +++ b/test/data/number1.dict @@ -0,0 +1 @@ +{"options.integer": null} \ No newline at end of file diff --git a/test/data/number1.json b/test/data/number1.json new file mode 100644 index 0000000..db7fad0 --- /dev/null +++ b/test/data/number1.json @@ -0,0 +1,28 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.integer": { + "name": "options.integer", + "title": "integer 1", + "type": "number" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "type": "input", + "allowedpattern": "[0-9]", + "key": "options.integer" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/number1_frozen.dict b/test/data/number1_frozen.dict new file mode 100644 index 0000000..0fe21fa --- /dev/null +++ b/test/data/number1_frozen.dict @@ -0,0 +1 @@ +{"options.integer": null} \ No newline at end of file diff --git a/test/data/number1_frozen.json b/test/data/number1_frozen.json new file mode 100644 index 0000000..0ddd82b --- /dev/null +++ b/test/data/number1_frozen.json @@ -0,0 +1,33 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.integer": { + "name": "options.integer", + "type": "number", + "title": "integer 1 frozen" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.integer", + "readOnly": true + } + ], + "form": [ + { + "key": "options.integer", + "allowedpattern": "[0-9]", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/number1_mod_value.dict b/test/data/number1_mod_value.dict new file mode 100644 index 0000000..b4b051d --- /dev/null +++ b/test/data/number1_mod_value.dict @@ -0,0 +1 @@ +{"options.integer": 3} \ No newline at end of file diff --git a/test/data/number1_mod_value.json b/test/data/number1_mod_value.json new file mode 100644 index 0000000..52b9430 --- /dev/null +++ b/test/data/number1_mod_value.json @@ -0,0 +1,36 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.integer": { + "name": "options.integer", + "title": "integer 1", + "type": "number", + "value": 0 + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.integer", + "value": 3, + "owner": "user" + } + ], + "form": [ + { + "clearable": true, + "type": "input", + "allowedpattern": "[0-9]", + "key": "options.integer" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/number1_value.dict b/test/data/number1_value.dict new file mode 100644 index 0000000..efbc36f --- /dev/null +++ b/test/data/number1_value.dict @@ -0,0 +1 @@ +{"options.integer": 0} \ No newline at end of file diff --git a/test/data/number1_value.json b/test/data/number1_value.json new file mode 100644 index 0000000..35c2045 --- /dev/null +++ b/test/data/number1_value.json @@ -0,0 +1,36 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.integer": { + "name": "options.integer", + "title": "integer 1", + "type": "number", + "value": 0 + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.integer", + "value": 0, + "owner": "default" + } + ], + "form": [ + { + "clearable": true, + "type": "input", + "allowedpattern": "[0-9]", + "key": "options.integer" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1.dict b/test/data/unicode1.dict new file mode 100644 index 0000000..f37d92a --- /dev/null +++ b/test/data/unicode1.dict @@ -0,0 +1 @@ +{"options.unicode": null} \ No newline at end of file diff --git a/test/data/unicode1.json b/test/data/unicode1.json new file mode 100644 index 0000000..4f26bfe --- /dev/null +++ b/test/data/unicode1.json @@ -0,0 +1,27 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "title": "Unicode 1", + "type": "string" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "type": "input", + "key": "options.unicode" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_frozen.dict b/test/data/unicode1_frozen.dict new file mode 100644 index 0000000..f37d92a --- /dev/null +++ b/test/data/unicode1_frozen.dict @@ -0,0 +1 @@ +{"options.unicode": null} \ No newline at end of file diff --git a/test/data/unicode1_frozen.json b/test/data/unicode1_frozen.json new file mode 100644 index 0000000..b242423 --- /dev/null +++ b/test/data/unicode1_frozen.json @@ -0,0 +1,32 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "type": "string", + "title": "Unicode 1 frozen" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode", + "readOnly": true + } + ], + "form": [ + { + "key": "options.unicode", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_mandatory.dict b/test/data/unicode1_mandatory.dict new file mode 100644 index 0000000..f37d92a --- /dev/null +++ b/test/data/unicode1_mandatory.dict @@ -0,0 +1 @@ +{"options.unicode": null} \ No newline at end of file diff --git a/test/data/unicode1_mandatory.json b/test/data/unicode1_mandatory.json new file mode 100644 index 0000000..626469e --- /dev/null +++ b/test/data/unicode1_mandatory.json @@ -0,0 +1,32 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "title": "Unicode 1", + "type": "string" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode", + "required": true + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_hidden_slaves.dict b/test/data/unicode1_master_hidden_slaves.dict new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/test/data/unicode1_master_hidden_slaves.dict @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/data/unicode1_master_hidden_slaves.json b/test/data/unicode1_master_hidden_slaves.json new file mode 100644 index 0000000..96402fb --- /dev/null +++ b/test/data/unicode1_master_hidden_slaves.json @@ -0,0 +1,72 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "properties": { + "options.unicode.unicode": { + "name": "options.unicode.unicode", + "type": "string", + "isMulti": true, + "title": "Unicode master" + }, + "options.unicode.unicode1": { + "name": "options.unicode.unicode1", + "type": "string", + "isMulti": true, + "title": "Unicode slave 1" + }, + "options.unicode.unicode2": { + "name": "options.unicode.unicode2", + "type": "string", + "isMulti": true, + "title": "Unicode slave 2" + }, + "options.unicode.unicode3": { + "name": "options.unicode.unicode3", + "type": "string", + "isMulti": true, + "title": "Unicode slave 3" + } + }, + "type": "array", + "title": "Common configuration" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode.unicode", + "display": false, + "required": true, + "hidden": true + } + ], + "form": [ + { + "key": "options.unicode.unicode", + "type": "input" + }, + { + "key": "options.unicode.unicode1", + "type": "input" + }, + { + "key": "options.unicode.unicode2", + "type": "input" + }, + { + "key": "options.unicode.unicode3", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves.dict b/test/data/unicode1_master_slaves.dict new file mode 100644 index 0000000..c22a5fe --- /dev/null +++ b/test/data/unicode1_master_slaves.dict @@ -0,0 +1 @@ +{"options.unicode.unicode": [], "options.unicode.unicode1": [], "options.unicode.unicode2": [], "options.unicode.unicode3": []} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves.json b/test/data/unicode1_master_slaves.json new file mode 100644 index 0000000..5f73f28 --- /dev/null +++ b/test/data/unicode1_master_slaves.json @@ -0,0 +1,70 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "properties": { + "options.unicode.unicode": { + "name": "options.unicode.unicode", + "title": "Unicode master", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode1": { + "name": "options.unicode.unicode1", + "title": "Unicode slave 1", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode2": { + "name": "options.unicode.unicode2", + "title": "Unicode slave 2", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode3": { + "name": "options.unicode.unicode3", + "title": "Unicode slave 3", + "type": "string", + "isMulti": true + } + }, + "type": "array", + "title": "Common configuration 1" + } + }, + "type": "object", + "title": "Common configuration 2" + } + }, + "model": [ + { + "key": "options.unicode.unicode", + "required": true + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode.unicode" + }, + { + "type": "input", + "key": "options.unicode.unicode1" + }, + { + "type": "input", + "key": "options.unicode.unicode2" + }, + { + "type": "input", + "key": "options.unicode.unicode3" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_default_value.dict b/test/data/unicode1_master_slaves_default_value.dict new file mode 100644 index 0000000..1b4e6a8 --- /dev/null +++ b/test/data/unicode1_master_slaves_default_value.dict @@ -0,0 +1 @@ +{"options.unicode.unicode": ["val1", "val2"], "options.unicode.unicode1": [null, null], "options.unicode.unicode2": ["slave2", "slave2"], "options.unicode.unicode3": [null, null]} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_default_value.json b/test/data/unicode1_master_slaves_default_value.json new file mode 100644 index 0000000..f098989 --- /dev/null +++ b/test/data/unicode1_master_slaves_default_value.json @@ -0,0 +1,94 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "properties": { + "options.unicode.unicode": { + "name": "options.unicode.unicode", + "title": "Unicode master", + "type": "string", + "value": [ + "val1", + "val2" + ], + "isMulti": true + }, + "options.unicode.unicode1": { + "name": "options.unicode.unicode1", + "title": "Unicode slave 1", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode2": { + "name": "options.unicode.unicode2", + "title": "Unicode slave 2 with default multi", + "type": "string", + "isMulti": true, + "default": "slave2" + }, + "options.unicode.unicode3": { + "name": "options.unicode.unicode3", + "title": "Unicode slave 3", + "type": "string", + "isMulti": true + } + }, + "type": "array", + "title": "Common configuration 1" + } + }, + "type": "object", + "title": "Common configuration 2" + } + }, + "model": [ + { + "key": "options.unicode.unicode", + "required": true, + "value": [ + "val1", + "val2" + ], + "owner": "default" + }, + { + "key": "options.unicode.unicode2", + "index": 0, + "value": "slave2", + "owner": "default" + }, + { + "key": "options.unicode.unicode2", + "index": 1, + "value": "slave2", + "owner": "default" + } + ], + "form": [ + { + "clearable": true, + "type": "input", + "key": "options.unicode.unicode" + }, + { + "type": "input", + "key": "options.unicode.unicode1" + }, + { + "clearable": true, + "type": "input", + "key": "options.unicode.unicode2" + }, + { + "type": "input", + "key": "options.unicode.unicode3" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_hidden.dict b/test/data/unicode1_master_slaves_hidden.dict new file mode 100644 index 0000000..e16c7e2 --- /dev/null +++ b/test/data/unicode1_master_slaves_hidden.dict @@ -0,0 +1 @@ +{"options.unicode.unicode": ["val1", "val2"], "options.unicode.unicode1": [null, null], "options.unicode.unicode3": [null, null]} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_hidden.json b/test/data/unicode1_master_slaves_hidden.json new file mode 100644 index 0000000..06d0187 --- /dev/null +++ b/test/data/unicode1_master_slaves_hidden.json @@ -0,0 +1,94 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "properties": { + "options.unicode.unicode": { + "name": "options.unicode.unicode", + "type": "string", + "isMulti": true, + "title": "Unicode master" + }, + "options.unicode.unicode1": { + "name": "options.unicode.unicode1", + "type": "string", + "isMulti": true, + "title": "Unicode slave 1" + }, + "options.unicode.unicode2": { + "name": "options.unicode.unicode2", + "type": "string", + "isMulti": true, + "title": "Unicode slave 2 hidden" + }, + "options.unicode.unicode3": { + "name": "options.unicode.unicode3", + "type": "string", + "isMulti": true, + "title": "Unicode slave 3" + } + }, + "type": "array", + "title": "Common configuration" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode.unicode", + "required": true, + "value": [ + "val1", + "val2" + ], + "owner": "user" + }, + { + "key": "options.unicode.unicode2", + "display": false, + "hidden": true, + "index": 0, + "value": "super", + "owner": "user" + }, + { + "key": "options.unicode.unicode2", + "display": false, + "hidden": true, + "index": 1 + }, + { + "key": "options.unicode.unicode2", + "display": false, + "hidden": true + } + ], + "form": [ + { + "key": "options.unicode.unicode", + "type": "input" + }, + { + "key": "options.unicode.unicode1", + "type": "input" + }, + { + "key": "options.unicode.unicode2", + "type": "input" + }, + { + "key": "options.unicode.unicode3", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_hidden_all_default.dict b/test/data/unicode1_master_slaves_hidden_all_default.dict new file mode 100644 index 0000000..42ebc9a --- /dev/null +++ b/test/data/unicode1_master_slaves_hidden_all_default.dict @@ -0,0 +1 @@ +{"options.unicode": null, "options.unicode1.unicode1": [], "options.unicode1.unicode2": [], "options.unicode1.unicode3": []} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_hidden_all_default.json b/test/data/unicode1_master_slaves_hidden_all_default.json new file mode 100644 index 0000000..46d641d --- /dev/null +++ b/test/data/unicode1_master_slaves_hidden_all_default.json @@ -0,0 +1,69 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "title": "Unicode master", + "type": "string" + }, + "options.unicode1": { + "name": "options.unicode1", + "properties": { + "options.unicode1.unicode1": { + "name": "options.unicode1.unicode1", + "title": "Unicode slave 1", + "type": "string", + "isMulti": true + }, + "options.unicode1.unicode2": { + "name": "options.unicode1.unicode2", + "title": "Unicode slave 2", + "type": "string", + "isMulti": true + }, + "options.unicode1.unicode3": { + "name": "options.unicode1.unicode3", + "title": "Unicode slave 3", + "type": "string", + "isMulti": true + } + }, + "type": "array", + "title": "Common configuration" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode1.unicode1", + "required": true + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode" + }, + { + "type": "input", + "key": "options.unicode1.unicode1" + }, + { + "type": "input", + "key": "options.unicode1.unicode2" + }, + { + "type": "input", + "key": "options.unicode1.unicode3" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_not_equal.dict b/test/data/unicode1_master_slaves_not_equal.dict new file mode 100644 index 0000000..c22a5fe --- /dev/null +++ b/test/data/unicode1_master_slaves_not_equal.dict @@ -0,0 +1 @@ +{"options.unicode.unicode": [], "options.unicode.unicode1": [], "options.unicode.unicode2": [], "options.unicode.unicode3": []} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_not_equal.json b/test/data/unicode1_master_slaves_not_equal.json new file mode 100644 index 0000000..58c75aa --- /dev/null +++ b/test/data/unicode1_master_slaves_not_equal.json @@ -0,0 +1,76 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "properties": { + "options.unicode.unicode": { + "name": "options.unicode.unicode", + "title": "Unicode master", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode1": { + "name": "options.unicode.unicode1", + "title": "Unicode slave 1", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode2": { + "name": "options.unicode.unicode2", + "title": "Unicode slave 2 not equal", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode3": { + "name": "options.unicode.unicode3", + "title": "Unicode slave 3 not equal", + "type": "string", + "isMulti": true + } + }, + "type": "array", + "title": "Common configuration 1" + } + }, + "type": "object", + "title": "Common configuration 2" + } + }, + "model": [ + { + "key": "options.unicode.unicode", + "required": true + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode.unicode" + }, + { + "type": "input", + "key": "options.unicode.unicode1" + }, + { + "type": "input", + "not_equal": {"options": [ + "options.unicode.unicode3" + ]}, + "key": "options.unicode.unicode2" + }, + { + "type": "input", + "not_equal": {"options": [ + "options.unicode.unicode2" + ]}, + "key": "options.unicode.unicode3" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/unicode1_master_slaves_requires.dict b/test/data/unicode1_master_slaves_requires.dict new file mode 100644 index 0000000..105f009 --- /dev/null +++ b/test/data/unicode1_master_slaves_requires.dict @@ -0,0 +1 @@ +{"options.unicode.unicode": [], "options.unicode.unicode1": [], "options.unicode.unicode2": []} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires.json b/test/data/unicode1_master_slaves_requires.json new file mode 100644 index 0000000..786a3dd --- /dev/null +++ b/test/data/unicode1_master_slaves_requires.json @@ -0,0 +1,84 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "properties": { + "options.unicode.unicode": { + "name": "options.unicode.unicode", + "title": "Unicode master", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode1": { + "name": "options.unicode.unicode1", + "title": "Unicode slave 1", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode2": { + "name": "options.unicode.unicode2", + "title": "Values 'test' must show 'Unicode slave 3'", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode3": { + "name": "options.unicode.unicode3", + "title": "Unicode slave 3", + "type": "string", + "isMulti": true + } + }, + "type": "array", + "title": "Common configuration 1" + } + }, + "type": "object", + "title": "Common configuration 2" + } + }, + "model": [ + { + "key": "options.unicode.unicode", + "required": true + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode.unicode" + }, + { + "type": "input", + "key": "options.unicode.unicode1" + }, + { + "type": "input", + "dependencies": { + "default": { + "hide": [ + "options.unicode.unicode3" + ] + }, + "expected": { + "test": { + "show": [ + "options.unicode.unicode3" + ] + } + } + }, + "key": "options.unicode.unicode2" + }, + { + "type": "input", + "key": "options.unicode.unicode3" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/unicode1_master_slaves_requires_all.dict b/test/data/unicode1_master_slaves_requires_all.dict new file mode 100644 index 0000000..f37d92a --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_all.dict @@ -0,0 +1 @@ +{"options.unicode": null} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_all.json b/test/data/unicode1_master_slaves_requires_all.json new file mode 100644 index 0000000..6be66a2 --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_all.json @@ -0,0 +1,90 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "type": "string", + "title": "Value 'test' must show MasterSlaves" + }, + "options.unicode1": { + "name": "options.unicode1", + "properties": { + "options.unicode1.unicode1": { + "name": "options.unicode1.unicode1", + "type": "string", + "isMulti": true, + "title": "Unicode master" + }, + "options.unicode1.unicode2": { + "name": "options.unicode1.unicode2", + "type": "string", + "isMulti": true, + "title": "Unicode slave 1" + }, + "options.unicode1.unicode3": { + "name": "options.unicode1.unicode3", + "type": "string", + "isMulti": true, + "title": "Unicode slave 2" + } + }, + "type": "array", + "title": "Common configuration" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode1", + "properties": [ + "hidden" + ], + "hidden": true + }, + { + "key": "options.unicode1.unicode1", + "required": true + } + ], + "form": [ + { + "key": "options.unicode", + "type": "input", + "dependencies": { + "default": { + "hide": [ + "options.unicode1" + ] + }, + "expected": { + "test": { + "show": [ + "options.unicode1" + ] + } + } + } + }, + { + "key": "options.unicode1.unicode1", + "type": "input" + }, + { + "key": "options.unicode1.unicode2", + "type": "input" + }, + { + "key": "options.unicode1.unicode3", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_master.dict b/test/data/unicode1_master_slaves_requires_master.dict new file mode 100644 index 0000000..f37d92a --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_master.dict @@ -0,0 +1 @@ +{"options.unicode": null} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_master.json b/test/data/unicode1_master_slaves_requires_master.json new file mode 100644 index 0000000..7d4f49c --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_master.json @@ -0,0 +1,90 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "type": "string", + "title": "Value 'test' must show master" + }, + "options.unicode1": { + "name": "options.unicode1", + "properties": { + "options.unicode1.unicode1": { + "name": "options.unicode1.unicode1", + "type": "string", + "isMulti": true, + "title": "Unicode master" + }, + "options.unicode1.unicode2": { + "name": "options.unicode1.unicode2", + "type": "string", + "isMulti": true, + "title": "Unicode slave 1" + }, + "options.unicode1.unicode3": { + "name": "options.unicode1.unicode3", + "type": "string", + "isMulti": true, + "title": "Unicode slave 2" + } + }, + "type": "array", + "title": "Common configuration" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode1", + "properties": [ + "hidden" + ], + "hidden": true + }, + { + "key": "options.unicode1.unicode1", + "required": true + } + ], + "form": [ + { + "key": "options.unicode", + "type": "input", + "dependencies": { + "default": { + "hide": [ + "options.unicode1" + ] + }, + "expected": { + "test": { + "show": [ + "options.unicode1" + ] + } + } + } + }, + { + "key": "options.unicode1.unicode1", + "type": "input" + }, + { + "key": "options.unicode1.unicode2", + "type": "input" + }, + { + "key": "options.unicode1.unicode3", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_slave.dict b/test/data/unicode1_master_slaves_requires_slave.dict new file mode 100644 index 0000000..ae4c715 --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_slave.dict @@ -0,0 +1 @@ +{"options.unicode1.unicode1": [], "options.unicode1.unicode2": []} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_slave.json b/test/data/unicode1_master_slaves_requires_slave.json new file mode 100644 index 0000000..d3cb944 --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_slave.json @@ -0,0 +1,74 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "properties": { + "options.unicode1.unicode1": { + "name": "options.unicode1.unicode1", + "title": "Values 'test' must show 'Unicode slave 2'", + "type": "string", + "isMulti": true + }, + "options.unicode1.unicode2": { + "name": "options.unicode1.unicode2", + "title": "Unicode slave 1", + "type": "string", + "isMulti": true + }, + "options.unicode1.unicode3": { + "name": "options.unicode1.unicode3", + "title": "Unicode slave 2", + "type": "string", + "isMulti": true + } + }, + "type": "array", + "title": "Common configuration" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode1.unicode1", + "required": true + } + ], + "form": [ + { + "type": "input", + "dependencies": { + "default": { + "hide": [ + "options.unicode1.unicode3" + ] + }, + "expected": { + "test": { + "show": [ + "options.unicode1.unicode3" + ] + } + } + }, + "key": "options.unicode1.unicode1" + }, + { + "type": "input", + "key": "options.unicode1.unicode2" + }, + { + "type": "input", + "key": "options.unicode1.unicode3" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_slave_value.dict b/test/data/unicode1_master_slaves_requires_slave_value.dict new file mode 100644 index 0000000..8bb3b55 --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_slave_value.dict @@ -0,0 +1 @@ +{"options.unicode1.unicode1": ["test", "pas test"], "options.unicode1.unicode2": ["super1", null]} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_slave_value.json b/test/data/unicode1_master_slaves_requires_slave_value.json new file mode 100644 index 0000000..909c475 --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_slave_value.json @@ -0,0 +1,96 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "properties": { + "options.unicode1.unicode1": { + "name": "options.unicode1.unicode1", + "type": "string", + "isMulti": true, + "title": "Values 'test' must show 'Unicode slave 2'" + }, + "options.unicode1.unicode2": { + "name": "options.unicode1.unicode2", + "type": "string", + "isMulti": true, + "title": "Unicode slave 1" + }, + "options.unicode1.unicode3": { + "name": "options.unicode1.unicode3", + "type": "string", + "isMulti": true, + "title": "Unicode slave 2" + } + }, + "type": "array", + "title": "Common configuration" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode1.unicode1", + "required": true, + "value": [ + "test", + "pas test" + ], + "owner": "user" + }, + { + "key": "options.unicode1.unicode2", + "index": 0, + "value": "super1", + "owner": "user" + }, + { + "key": "options.unicode1.unicode3", + "index": 0, + "value": "super1", + "owner": "user" + }, + { + "key": "options.unicode1.unicode3", + "hidden": true, + "index": 1 + } + ], + "form": [ + { + "key": "options.unicode1.unicode1", + "type": "input", + "dependencies": { + "default": { + "hide": [ + "options.unicode1.unicode3" + ] + }, + "expected": { + "test": { + "show": [ + "options.unicode1.unicode3" + ] + } + } + } + }, + { + "key": "options.unicode1.unicode2", + "type": "input" + }, + { + "key": "options.unicode1.unicode3", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_slaves.dict b/test/data/unicode1_master_slaves_requires_slaves.dict new file mode 100644 index 0000000..ae4c715 --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_slaves.dict @@ -0,0 +1 @@ +{"options.unicode1.unicode1": [], "options.unicode1.unicode2": []} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_slaves.json b/test/data/unicode1_master_slaves_requires_slaves.json new file mode 100644 index 0000000..7111b7c --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_slaves.json @@ -0,0 +1,74 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "properties": { + "options.unicode1.unicode1": { + "name": "options.unicode1.unicode1", + "title": "Unicode master", + "type": "string", + "isMulti": true + }, + "options.unicode1.unicode2": { + "name": "options.unicode1.unicode2", + "title": "Values 'test' must show 'Unicode slave 2'", + "type": "string", + "isMulti": true + }, + "options.unicode1.unicode3": { + "name": "options.unicode1.unicode3", + "title": "Unicode slave 2", + "type": "string", + "isMulti": true + } + }, + "type": "array", + "title": "Common configuration" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode1.unicode1", + "required": true + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode1.unicode1" + }, + { + "type": "input", + "dependencies": { + "default": { + "hide": [ + "options.unicode1.unicode3" + ] + }, + "expected": { + "test": { + "show": [ + "options.unicode1.unicode3" + ] + } + } + }, + "key": "options.unicode1.unicode2" + }, + { + "type": "input", + "key": "options.unicode1.unicode3" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_value.dict b/test/data/unicode1_master_slaves_requires_value.dict new file mode 100644 index 0000000..ef49f2c --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_value.dict @@ -0,0 +1 @@ +{"options.unicode.unicode": ["test", "val2"], "options.unicode.unicode1": ["super1", "super2"], "options.unicode.unicode2": ["pas test", "test"]} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_requires_value.json b/test/data/unicode1_master_slaves_requires_value.json new file mode 100644 index 0000000..3dedfdf --- /dev/null +++ b/test/data/unicode1_master_slaves_requires_value.json @@ -0,0 +1,120 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "properties": { + "options.unicode.unicode": { + "name": "options.unicode.unicode", + "type": "string", + "isMulti": true, + "title": "Values 'test' must show 'Unicode slave 3'" + }, + "options.unicode.unicode1": { + "name": "options.unicode.unicode1", + "type": "string", + "isMulti": true, + "title": "Unicode slave 1" + }, + "options.unicode.unicode2": { + "name": "options.unicode.unicode2", + "type": "string", + "isMulti": true, + "title": "Unicode slave 2" + }, + "options.unicode.unicode3": { + "name": "options.unicode.unicode3", + "type": "string", + "isMulti": true, + "title": "Unicode slave 3" + } + }, + "type": "array", + "title": "Common configuration 1" + } + }, + "type": "object", + "title": "Common configuration 2" + } + }, + "model": [ + { + "key": "options.unicode.unicode", + "required": true, + "value": [ + "test", + "val2" + ], + "owner": "user" + }, + { + "key": "options.unicode.unicode1", + "index": 0, + "value": "super1", + "owner": "user" + }, + { + "key": "options.unicode.unicode1", + "index": 1, + "value": "super2", + "owner": "user" + }, + { + "key": "options.unicode.unicode2", + "index": 0, + "value": "pas test", + "owner": "user" + }, + { + "key": "options.unicode.unicode2", + "index": 1, + "value": "test", + "owner": "user" + }, + { + "key": "options.unicode.unicode3", + "hidden": true, + "index": 1, + "value": "super", + "owner": "user" + } + ], + "form": [ + { + "key": "options.unicode.unicode", + "type": "input", + "dependencies": { + "default": { + "hide": [ + "options.unicode.unicode3" + ] + }, + "expected": { + "test": { + "show": [ + "options.unicode.unicode3" + ] + } + } + } + }, + { + "key": "options.unicode.unicode1", + "type": "input" + }, + { + "key": "options.unicode.unicode2", + "type": "input" + }, + { + "key": "options.unicode.unicode3", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_submulti.dict b/test/data/unicode1_master_slaves_submulti.dict new file mode 100644 index 0000000..c22a5fe --- /dev/null +++ b/test/data/unicode1_master_slaves_submulti.dict @@ -0,0 +1 @@ +{"options.unicode.unicode": [], "options.unicode.unicode1": [], "options.unicode.unicode2": [], "options.unicode.unicode3": []} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_submulti.json b/test/data/unicode1_master_slaves_submulti.json new file mode 100644 index 0000000..1771d72 --- /dev/null +++ b/test/data/unicode1_master_slaves_submulti.json @@ -0,0 +1,71 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "properties": { + "options.unicode.unicode": { + "name": "options.unicode.unicode", + "title": "Unicode master", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode1": { + "name": "options.unicode.unicode1", + "title": "Unicode slave 1", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode2": { + "name": "options.unicode.unicode2", + "title": "Unicode slave 2 submulti", + "type": "string", + "isMulti": true, + "isSubMulti": true + }, + "options.unicode.unicode3": { + "name": "options.unicode.unicode3", + "title": "Unicode slave 3", + "type": "string", + "isMulti": true + } + }, + "type": "array", + "title": "Common configuration 1" + } + }, + "type": "object", + "title": "Common configuration 2" + } + }, + "model": [ + { + "key": "options.unicode.unicode", + "required": true + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode.unicode" + }, + { + "type": "input", + "key": "options.unicode.unicode1" + }, + { + "type": "input", + "key": "options.unicode.unicode2" + }, + { + "type": "input", + "key": "options.unicode.unicode3" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_value.dict b/test/data/unicode1_master_slaves_value.dict new file mode 100644 index 0000000..293ee40 --- /dev/null +++ b/test/data/unicode1_master_slaves_value.dict @@ -0,0 +1 @@ +{"options.unicode.unicode": ["val3", "val4"], "options.unicode.unicode1": ["super1", "super2"], "options.unicode.unicode2": ["pas test", "test"], "options.unicode.unicode3": [null, "super"]} \ No newline at end of file diff --git a/test/data/unicode1_master_slaves_value.json b/test/data/unicode1_master_slaves_value.json new file mode 100644 index 0000000..9294971 --- /dev/null +++ b/test/data/unicode1_master_slaves_value.json @@ -0,0 +1,112 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "properties": { + "options.unicode.unicode": { + "name": "options.unicode.unicode", + "title": "Unicode master", + "type": "string", + "value": [ + "val1", + "val2" + ], + "isMulti": true + }, + "options.unicode.unicode1": { + "name": "options.unicode.unicode1", + "title": "Unicode slave 1", + "type": "string", + "isMulti": true + }, + "options.unicode.unicode2": { + "name": "options.unicode.unicode2", + "title": "Unicode slave 2 with default multi", + "type": "string", + "isMulti": true, + "default": "slave2" + }, + "options.unicode.unicode3": { + "name": "options.unicode.unicode3", + "title": "Unicode slave 3", + "type": "string", + "isMulti": true + } + }, + "type": "array", + "title": "Common configuration 1" + } + }, + "type": "object", + "title": "Common configuration 2" + } + }, + "model": [ + { + "key": "options.unicode.unicode", + "required": true, + "value": [ + "val3", + "val4" + ], + "owner": "user" + }, + { + "key": "options.unicode.unicode1", + "index": 0, + "value": "super1", + "owner": "user" + }, + { + "key": "options.unicode.unicode1", + "index": 1, + "value": "super2", + "owner": "user" + }, + { + "key": "options.unicode.unicode2", + "index": 0, + "value": "pas test", + "owner": "user" + }, + { + "key": "options.unicode.unicode2", + "index": 1, + "value": "test", + "owner": "user" + }, + { + "key": "options.unicode.unicode3", + "index": 1, + "value": "super", + "owner": "user" + } + ], + "form": [ + { + "clearable": true, + "type": "input", + "key": "options.unicode.unicode" + }, + { + "type": "input", + "key": "options.unicode.unicode1" + }, + { + "clearable": true, + "type": "input", + "key": "options.unicode.unicode2" + }, + { + "type": "input", + "key": "options.unicode.unicode3" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/unicode1_mod_value.dict b/test/data/unicode1_mod_value.dict new file mode 100644 index 0000000..47f8cfd --- /dev/null +++ b/test/data/unicode1_mod_value.dict @@ -0,0 +1 @@ +{"options.unicode": "a"} \ No newline at end of file diff --git a/test/data/unicode1_mod_value.json b/test/data/unicode1_mod_value.json new file mode 100644 index 0000000..c381da8 --- /dev/null +++ b/test/data/unicode1_mod_value.json @@ -0,0 +1,33 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "title": "Unicode 1", + "type": "string" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode", + "value": "a", + "owner": "user" + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_multi.dict b/test/data/unicode1_multi.dict new file mode 100644 index 0000000..c99ce8a --- /dev/null +++ b/test/data/unicode1_multi.dict @@ -0,0 +1 @@ +{"options.unicode": []} \ No newline at end of file diff --git a/test/data/unicode1_multi.json b/test/data/unicode1_multi.json new file mode 100644 index 0000000..dc8b0b5 --- /dev/null +++ b/test/data/unicode1_multi.json @@ -0,0 +1,33 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "title": "String 1", + "type": "string", + "isMulti": true + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode", + "required": true + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_multi_hidden.dict b/test/data/unicode1_multi_hidden.dict new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/test/data/unicode1_multi_hidden.dict @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/data/unicode1_multi_hidden.json b/test/data/unicode1_multi_hidden.json new file mode 100644 index 0000000..d42395e --- /dev/null +++ b/test/data/unicode1_multi_hidden.json @@ -0,0 +1,35 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "type": "string", + "isMulti": true, + "title": "Unicode 1" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode", + "display": false, + "required": true, + "hidden": true + } + ], + "form": [ + { + "key": "options.unicode", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_multi_mandatory.dict b/test/data/unicode1_multi_mandatory.dict new file mode 100644 index 0000000..c99ce8a --- /dev/null +++ b/test/data/unicode1_multi_mandatory.dict @@ -0,0 +1 @@ +{"options.unicode": []} \ No newline at end of file diff --git a/test/data/unicode1_multi_mandatory.json b/test/data/unicode1_multi_mandatory.json new file mode 100644 index 0000000..595efd0 --- /dev/null +++ b/test/data/unicode1_multi_mandatory.json @@ -0,0 +1,34 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "title": "Unicode 1", + "type": "string", + "isMulti": true + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode", + "required": true, + "needs_len": true + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_multi_mod_value.dict b/test/data/unicode1_multi_mod_value.dict new file mode 100644 index 0000000..b49cbe8 --- /dev/null +++ b/test/data/unicode1_multi_mod_value.dict @@ -0,0 +1 @@ +{"options.unicode": ["c", "d", "e"]} \ No newline at end of file diff --git a/test/data/unicode1_multi_mod_value.json b/test/data/unicode1_multi_mod_value.json new file mode 100644 index 0000000..7088763 --- /dev/null +++ b/test/data/unicode1_multi_mod_value.json @@ -0,0 +1,44 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "title": "String 1", + "type": "string", + "value": [ + "a", + "b" + ], + "isMulti": true + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode", + "required": true, + "value": [ + "c", + "d", + "e" + ], + "owner": "user" + } + ], + "form": [ + { + "clearable": true, + "type": "input", + "key": "options.unicode" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_multi_not_equal_collapse.dict b/test/data/unicode1_multi_not_equal_collapse.dict new file mode 100644 index 0000000..9560c25 --- /dev/null +++ b/test/data/unicode1_multi_not_equal_collapse.dict @@ -0,0 +1 @@ +{"descr1.unicode1": null, "descr1.unicode1_multi": [], "descr2.unicode2": "a", "descr2.unicode2_multi": ["a", "b"], "descr3.unicode3": null, "descr3.unicode3_multi": []} \ No newline at end of file diff --git a/test/data/unicode1_multi_not_equal_collapse.json b/test/data/unicode1_multi_not_equal_collapse.json new file mode 100644 index 0000000..292995a --- /dev/null +++ b/test/data/unicode1_multi_not_equal_collapse.json @@ -0,0 +1,155 @@ +{ + "schema": { + "descr1": { + "name": "descr1", + "properties": { + "descr1.unicode1": { + "name": "descr1.unicode1", + "type": "string", + "title": "Unicode 1, not equal to 'a'" + }, + "descr1.unicode1_multi": { + "name": "descr1.unicode1_multi", + "type": "string", + "isMulti": true, + "title": "Multi unicode 1, not equal to 'a' or 'b'" + } + }, + "type": "object", + "title": "Common configuration 1" + }, + "descr2": { + "name": "descr2", + "properties": { + "descr2.unicode2": { + "name": "descr2.unicode2", + "type": "string", + "value": "a", + "title": "Unicode 2" + }, + "descr2.unicode2_multi": { + "name": "descr2.unicode2_multi", + "type": "string", + "value": [ + "a", + "b" + ], + "isMulti": true, + "title": "Multi unicode 2" + } + }, + "type": "object", + "title": "Common configuration 2" + }, + "descr3": { + "name": "descr3", + "properties": { + "descr3.unicode3": { + "name": "descr3.unicode3", + "type": "string", + "title": "Unicode 3" + }, + "descr3.unicode3_multi": { + "name": "descr3.unicode3_multi", + "type": "string", + "isMulti": true, + "title": "Multi unicode 3" + } + }, + "type": "object", + "title": "Common configuration 3" + } + }, + "model": [ + { + "key": "descr1.unicode1_multi", + "required": true + }, + { + "key": "descr2.unicode2", + "value": "a", + "owner": "default" + }, + { + "key": "descr2.unicode2_multi", + "required": true, + "value": [ + "a", + "b" + ], + "owner": "default" + }, + { + "key": "descr3.unicode3_multi", + "required": true + } + ], + "form": [ + { + "key": "descr1.unicode1", + "type": "input", + "not_equal": {"options": [ + "descr2.unicode2", + "descr3.unicode3" + ]} + }, + { + "key": "descr1.unicode1_multi", + "type": "input", + "not_equal": {"options": [ + "descr2.unicode2_multi", + "descr3.unicode3_multi" + ]} + }, + { + "key": "descr2.unicode2", + "clearable": true, + "type": "input", + "not_equal": {"options": [ + "descr1.unicode1", + "descr3.unicode3" + ]} + }, + { + "key": "descr2.unicode2_multi", + "clearable": true, + "type": "input", + "not_equal": {"options": [ + "descr1.unicode1_multi", + "descr3.unicode3_multi" + ]} + }, + { + "key": "descr3.unicode3", + "type": "input", + "not_equal": {"options": [ + "descr1.unicode1", + "descr2.unicode2" + ]} + }, + { + "key": "descr3.unicode3_multi", + "type": "input", + "not_equal": {"options": [ + "descr1.unicode1_multi", + "descr2.unicode2_multi" + ]} + }, + { + "key": "descr1", + "collapse": true + }, + { + "key": "descr2", + "collapse": true + }, + { + "key": "descr3", + "collapse": true + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/unicode1_multi_requires.dict b/test/data/unicode1_multi_requires.dict new file mode 100644 index 0000000..3119031 --- /dev/null +++ b/test/data/unicode1_multi_requires.dict @@ -0,0 +1 @@ +{"options.unicode1": null} \ No newline at end of file diff --git a/test/data/unicode1_multi_requires.json b/test/data/unicode1_multi_requires.json new file mode 100644 index 0000000..7d727b3 --- /dev/null +++ b/test/data/unicode1_multi_requires.json @@ -0,0 +1,57 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "type": "string", + "title": "Value 'test' must show Unicode 2" + }, + "options.unicode2": { + "name": "options.unicode2", + "type": "string", + "isMulti": true, + "title": "Unicode 2" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode2", + "required": true, + "hidden": true + } + ], + "form": [ + { + "key": "options.unicode1", + "type": "input", + "dependencies": { + "default": { + "hide": [ + "options.unicode2" + ] + }, + "expected": { + "test": { + "show": [ + "options.unicode2" + ] + } + } + } + }, + { + "key": "options.unicode2", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_multi_value.dict b/test/data/unicode1_multi_value.dict new file mode 100644 index 0000000..90041ac --- /dev/null +++ b/test/data/unicode1_multi_value.dict @@ -0,0 +1 @@ +{"options.unicode": ["a", "b"]} \ No newline at end of file diff --git a/test/data/unicode1_multi_value.json b/test/data/unicode1_multi_value.json new file mode 100644 index 0000000..4aed1f5 --- /dev/null +++ b/test/data/unicode1_multi_value.json @@ -0,0 +1,43 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "title": "String 1", + "type": "string", + "value": [ + "a", + "b" + ], + "isMulti": true + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode", + "required": true, + "value": [ + "a", + "b" + ], + "owner": "default" + } + ], + "form": [ + { + "clearable": true, + "type": "input", + "key": "options.unicode" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_not_equal.dict b/test/data/unicode1_not_equal.dict new file mode 100644 index 0000000..e26c1b3 --- /dev/null +++ b/test/data/unicode1_not_equal.dict @@ -0,0 +1 @@ +{"options.unicode1": null, "options.unicode2": null} \ No newline at end of file diff --git a/test/data/unicode1_not_equal.json b/test/data/unicode1_not_equal.json new file mode 100644 index 0000000..bc44e99 --- /dev/null +++ b/test/data/unicode1_not_equal.json @@ -0,0 +1,42 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "title": "Unicode 1", + "type": "string" + }, + "options.unicode2": { + "name": "options.unicode2", + "title": "Unicode 2", + "type": "string" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "type": "input", + "not_equal": {"options": [ + "options.unicode2" + ]}, + "key": "options.unicode1" + }, + { + "type": "input", + "not_equal": {"options": [ + "options.unicode1" + ]}, + "key": "options.unicode2" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} diff --git a/test/data/unicode1_optiondescription_requires.dict b/test/data/unicode1_optiondescription_requires.dict new file mode 100644 index 0000000..3119031 --- /dev/null +++ b/test/data/unicode1_optiondescription_requires.dict @@ -0,0 +1 @@ +{"options.unicode1": null} \ No newline at end of file diff --git a/test/data/unicode1_optiondescription_requires.json b/test/data/unicode1_optiondescription_requires.json new file mode 100644 index 0000000..45c7ef7 --- /dev/null +++ b/test/data/unicode1_optiondescription_requires.json @@ -0,0 +1,74 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "type": "string", + "title": "Value 'test' must show OptionDescription" + } + }, + "type": "object", + "title": "Common configuration" + }, + "unicode1": { + "name": "unicode1", + "properties": { + "unicode1.unicode2": { + "name": "unicode1.unicode2", + "type": "string", + "title": "Unicode 2" + }, + "unicode1.unicode3": { + "name": "unicode1.unicode3", + "type": "string", + "title": "Unicode 3" + } + }, + "type": "object", + "title": "OptionDescription with 2 options" + } + }, + "model": [ + { + "key": "unicode1", + "properties": [ + "hidden" + ], + "hidden": true + } + ], + "form": [ + { + "key": "options.unicode1", + "type": "input", + "dependencies": { + "default": { + "hide": [ + "unicode1" + ] + }, + "expected": { + "test": { + "show": [ + "unicode1" + ] + } + } + } + }, + { + "key": "unicode1.unicode2", + "type": "input" + }, + { + "key": "unicode1.unicode3", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_requires.dict b/test/data/unicode1_requires.dict new file mode 100644 index 0000000..3119031 --- /dev/null +++ b/test/data/unicode1_requires.dict @@ -0,0 +1 @@ +{"options.unicode1": null} \ No newline at end of file diff --git a/test/data/unicode1_requires.json b/test/data/unicode1_requires.json new file mode 100644 index 0000000..8b0afe5 --- /dev/null +++ b/test/data/unicode1_requires.json @@ -0,0 +1,55 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "type": "string", + "title": "Value 'test' must show Unicode 2" + }, + "options.unicode2": { + "name": "options.unicode2", + "type": "string", + "title": "Unicode 2" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode2", + "hidden": true + } + ], + "form": [ + { + "key": "options.unicode1", + "type": "input", + "dependencies": { + "default": { + "hide": [ + "options.unicode2" + ] + }, + "expected": { + "test": { + "show": [ + "options.unicode2" + ] + } + } + } + }, + { + "key": "options.unicode2", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode1_simple_callback.dict b/test/data/unicode1_simple_callback.dict new file mode 100644 index 0000000..8136faa --- /dev/null +++ b/test/data/unicode1_simple_callback.dict @@ -0,0 +1 @@ +{"options.unicode1": "word"} \ No newline at end of file diff --git a/test/data/unicode1_simple_callback.json b/test/data/unicode1_simple_callback.json new file mode 100644 index 0000000..9282567 --- /dev/null +++ b/test/data/unicode1_simple_callback.json @@ -0,0 +1,35 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "type": "string", + "value": "word", + "title": "Unicode 1" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode1", + "value": "word", + "owner": "default" + } + ], + "form": [ + { + "key": "options.unicode1", + "clearable": true, + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode2.dict b/test/data/unicode2.dict new file mode 100644 index 0000000..e26c1b3 --- /dev/null +++ b/test/data/unicode2.dict @@ -0,0 +1 @@ +{"options.unicode1": null, "options.unicode2": null} \ No newline at end of file diff --git a/test/data/unicode2.json b/test/data/unicode2.json new file mode 100644 index 0000000..d2b1fad --- /dev/null +++ b/test/data/unicode2.json @@ -0,0 +1,36 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "title": "Unicode 1", + "type": "string" + }, + "options.unicode2": { + "name": "options.unicode2", + "title": "Unicode 2", + "type": "string" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "type": "input", + "key": "options.unicode1" + }, + { + "type": "input", + "key": "options.unicode2" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode2_copy.dict b/test/data/unicode2_copy.dict new file mode 100644 index 0000000..e26c1b3 --- /dev/null +++ b/test/data/unicode2_copy.dict @@ -0,0 +1 @@ +{"options.unicode1": null, "options.unicode2": null} \ No newline at end of file diff --git a/test/data/unicode2_copy.json b/test/data/unicode2_copy.json new file mode 100644 index 0000000..f6f7e34 --- /dev/null +++ b/test/data/unicode2_copy.json @@ -0,0 +1,40 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "type": "string", + "title": "Unicode 1" + }, + "options.unicode2": { + "name": "options.unicode2", + "type": "string", + "title": "Unicode 2 (copy)" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "key": "options.unicode1", + "type": "input", + "copy": [ + "options.unicode2" + ] + }, + { + "key": "options.unicode2", + "type": "input", + "clearable": true + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode2_multi_copy.dict b/test/data/unicode2_multi_copy.dict new file mode 100644 index 0000000..fdff5a0 --- /dev/null +++ b/test/data/unicode2_multi_copy.dict @@ -0,0 +1 @@ +{"options.unicode1": [], "options.unicode2": []} \ No newline at end of file diff --git a/test/data/unicode2_multi_copy.json b/test/data/unicode2_multi_copy.json new file mode 100644 index 0000000..760fe6b --- /dev/null +++ b/test/data/unicode2_multi_copy.json @@ -0,0 +1,51 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode1": { + "name": "options.unicode1", + "title": "Unicode 1", + "type": "string", + "isMulti": true + }, + "options.unicode2": { + "name": "options.unicode2", + "title": "Unicode 2", + "type": "string", + "isMulti": true + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode1", + "required": true + }, + { + "key": "options.unicode2", + "required": true + } + ], + "form": [ + { + "type": "input", + "copy": [ + "options.unicode2" + ], + "key": "options.unicode1" + }, + { + "clearable": true, + "type": "input", + "key": "options.unicode2" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode_hidden.dict b/test/data/unicode_hidden.dict new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/test/data/unicode_hidden.dict @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/data/unicode_hidden.json b/test/data/unicode_hidden.json new file mode 100644 index 0000000..52d852c --- /dev/null +++ b/test/data/unicode_hidden.json @@ -0,0 +1,33 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "type": "string", + "title": "Unicode 1" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode", + "display": false, + "hidden": true + } + ], + "form": [ + { + "key": "options.unicode", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode_property.dict b/test/data/unicode_property.dict new file mode 100644 index 0000000..f37d92a --- /dev/null +++ b/test/data/unicode_property.dict @@ -0,0 +1 @@ +{"options.unicode": null} \ No newline at end of file diff --git a/test/data/unicode_property.json b/test/data/unicode_property.json new file mode 100644 index 0000000..0cb68f6 --- /dev/null +++ b/test/data/unicode_property.json @@ -0,0 +1,34 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "title": "Expert unicode", + "type": "string" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.unicode", + "properties": [ + "expert" + ] + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/unicode_property_optiondescription.dict b/test/data/unicode_property_optiondescription.dict new file mode 100644 index 0000000..f37d92a --- /dev/null +++ b/test/data/unicode_property_optiondescription.dict @@ -0,0 +1 @@ +{"options.unicode": null} \ No newline at end of file diff --git a/test/data/unicode_property_optiondescription.json b/test/data/unicode_property_optiondescription.json new file mode 100644 index 0000000..77d1947 --- /dev/null +++ b/test/data/unicode_property_optiondescription.json @@ -0,0 +1,34 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.unicode": { + "name": "options.unicode", + "title": "Expert unicode", + "type": "string" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options", + "properties": [ + "expert" + ] + } + ], + "form": [ + { + "type": "input", + "key": "options.unicode" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/username1.dict b/test/data/username1.dict new file mode 100644 index 0000000..f5b5181 --- /dev/null +++ b/test/data/username1.dict @@ -0,0 +1 @@ +{"options.username": null} \ No newline at end of file diff --git a/test/data/username1.json b/test/data/username1.json new file mode 100644 index 0000000..93a6b9d --- /dev/null +++ b/test/data/username1.json @@ -0,0 +1,28 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.username": { + "name": "options.username", + "title": "Username description", + "type": "string" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [], + "form": [ + { + "type": "input", + "pattern": "^[a-z_][a-z0-9_-]{0,30}[$a-z0-9_-]{0,1}$", + "key": "options.username" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/data/username1_frozen.dict b/test/data/username1_frozen.dict new file mode 100644 index 0000000..f5b5181 --- /dev/null +++ b/test/data/username1_frozen.dict @@ -0,0 +1 @@ +{"options.username": null} \ No newline at end of file diff --git a/test/data/username1_frozen.json b/test/data/username1_frozen.json new file mode 100644 index 0000000..d0ace35 --- /dev/null +++ b/test/data/username1_frozen.json @@ -0,0 +1,33 @@ +{ + "schema": { + "options": { + "name": "options", + "properties": { + "options.username": { + "name": "options.username", + "type": "string", + "title": "Username description frozen" + } + }, + "type": "object", + "title": "Common configuration" + } + }, + "model": [ + { + "key": "options.username", + "readOnly": true + } + ], + "form": [ + { + "key": "options.username", + "pattern": "^[a-z_][a-z0-9_-]{0,30}[$a-z0-9_-]{0,1}$", + "type": "input" + }, + { + "title": "Configurer", + "type": "submit" + } + ] +} \ No newline at end of file diff --git a/test/test_json.py b/test/test_json.py new file mode 100644 index 0000000..c9cb2e8 --- /dev/null +++ b/test/test_json.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +from json import loads +from os import listdir +from os.path import dirname, abspath, join, normpath, splitext +# import warnings + +# from tiramisu.error import ValueWarning +from tiramisu_json_api import Config + + +# warnings.simplefilter("always", ValueWarning) + + +def list_data(): + datadir = join(normpath(dirname(abspath(__file__))), 'data') + filenames = listdir(datadir) + filenames.sort() + for filename in filenames: + if filename.endswith('.json'): + yield join(datadir, filename) + + +def test_jsons(): + debug = False + # debug = True + for filename in list_data(): + if 'master' in filename: + continue + if debug: + print('test_jsons', filename) + with open(filename, 'r') as fh: + json = loads(fh.read()) + # + print(filename) + config = Config(json) + with open(filename[:-4] + 'dict', 'r') as fh: + assert loads(fh.read()) == config.value.dict() diff --git a/tiramisu_json_api/api.py b/tiramisu_json_api/api.py index 0d9c1e0..a2f44b7 100644 --- a/tiramisu_json_api/api.py +++ b/tiramisu_json_api/api.py @@ -161,7 +161,7 @@ class _Value: fullpath, withwarning) else: - value = self.config.get_value(key, schema) + value = self.config.get_value(key) self._display_warnings(key, value, option['type'], option['name'], withwarning) ret[key] = value @@ -235,7 +235,7 @@ class TiramisuOptionValue(_Value): self.index = index def get(self) -> Any: - value = self.config.get_value(self.path, self.schema) + value = self.config.get_value(self.path) self._display_warnings(self.path, value, self.schema['type'], self.schema['name']) return value @@ -601,13 +601,12 @@ class Config: return value def get_value(self, - path: str, - schema: Dict) -> Any: + path: str) -> Any: if 'value' in self.temp.get(path, {}): value = self.temp[path]['value'] else: value = self.model.get(path, {}).get('value') - if value is None and schema.get('isMulti', False): + if value is None and self.get_schema(path).get('isMulti', False): value = [] return value @@ -752,7 +751,7 @@ class Config: opts.append(path) for path_ in self.form[path]['not_equal']['options']: schema = self.get_schema(path_) - p_value = self.get_value(path_, schema) + p_value = self.get_value(path_) if isinstance(p_value, list): for val in p_value: vals.append(val)