tests: Modify tests to test reverse schema generation with multiple levels of nesting

This commit is contained in:
Shreya Malviya 2021-10-13 19:56:35 +05:30
parent ffd8f4edfe
commit f7f2e69152
2 changed files with 55 additions and 9 deletions

View File

@ -6,12 +6,15 @@ REVERSE_FAKE_SCHEMA = {
"T0000": { "T0000": {
"Definition Type 1": ["Config Option 1", "Config Option 2"], "Definition Type 1": ["Config Option 1", "Config Option 2"],
"Definition Type 2": ["Config Option 5", "Config Option 6"], "Definition Type 2": ["Config Option 5", "Config Option 6"],
"Property Type 1": ["Config Option 1 (Tab 1)"], "Property Type 1 -> Category 1": ["Config Option 1"],
}, "Property Type 2 -> Category 1": ["Config Option 1"],
"T0001": { "Property Type 2 -> Category 2 -> Config Option 1": ["Config Option 1.1"],
"Definition Type 1": ["Config Option 1"], "Property Type 2 -> Category 2 -> Config Option 2": ["Config Option 2.1"],
"Definition Type 2": ["Config Option 5"], "Property Type 2 -> Category 2 -> Config Option 2 -> Config Option 2.1": [
"Config Option 2.1.1"
],
}, },
"T0001": {"Definition Type 1": ["Config Option 1"], "Definition Type 2": ["Config Option 5"]},
} }

View File

@ -71,16 +71,59 @@ def fake_schema():
"property_type_1": { "property_type_1": {
"title": "Property Type 1", "title": "Property Type 1",
"properties": { "properties": {
"tab_1": { "category_1": {
"title": "Tab 1", "title": "Category 1",
"properties": { "properties": {
"config_option_1": { "config_option_1": {
"title": "Config Option 1", "title": "Config Option 1",
"related_attack_techniques": ["T0000"], "related_attack_techniques": ["T0000"],
}, },
}, },
},
},
},
"property_type_2": {
"title": "Property Type 2",
"properties": {
"category_1": {
"title": "Category 1",
"properties": {
"config_option_1": {
"title": "Config Option 1",
"related_attack_techniques": ["T0000"],
},
},
},
"category_2": {
"title": "Category 2",
"properties": {
"config_option_1": {
"title": "Config Option 1",
"properties": {
"config_option_1.1": {
"title": "Config Option 1.1",
"related_attack_techniques": ["T0000"],
},
},
},
"config_option_2": {
"title": "Config Option 2",
"properties": {
"config_option_2.1": {
"title": "Config Option 2.1",
"properties": {
"config_option_2.1.1": {
"title": "Config Option 2.1.1",
"related_attack_techniques": ["T0000"],
} }
}, },
} "related_attack_techniques": ["T0000"],
},
},
},
},
},
},
},
}, },
} }