-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for python utils and config validation (#1485)
**Issue number:** N/A ### PR Type **What kind of change does this PR introduce?** * [ ] Feature * [ ] Bug Fix * [ ] Refactoring (no functional or API changes) * [ ] Documentation Update * [x] Maintenance (dependency updates, CI, etc.) ## Summary Tests added for function `get_os_path` in `utils` valid config check when using `useInputToggleConfirmation` ### Changes Test cases added. ### User experience N/A ## Checklist If an item doesn't apply to your changes, leave it unchecked. * [x] I have performed a self-review of this change according to the [development guidelines](https://splunk.github.io/addonfactory-ucc-generator/contributing/#development-guidelines) * [x] Tests have been added/modified to cover the changes [(testing doc)](https://splunk.github.io/addonfactory-ucc-generator/contributing/#build-and-test) * [ ] Changes are documented * [x] PR title and description follows the [contributing principles](https://splunk.github.io/addonfactory-ucc-generator/contributing/#pull-requests)
- Loading branch information
1 parent
34c8ec2
commit 282e2ef
Showing
3 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
tests/unit/testdata/valid_config_with_input_status_confirmation.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"pages": { | ||
"configuration": { | ||
"tabs": [ | ||
{ | ||
"name": "account", | ||
"table": { | ||
"actions": ["edit", "delete", "clone"], | ||
"header": [ | ||
{ | ||
"label": "Name", | ||
"field": "name" | ||
} | ||
] | ||
}, | ||
"entity": [ | ||
{ | ||
"type": "text", | ||
"label": "Name", | ||
"validators": [ | ||
{ | ||
"type": "string", | ||
"errorMsg": "Length of ID should be between 1 and 50", | ||
"minLength": 1, | ||
"maxLength": 50 | ||
}, | ||
{ | ||
"type": "regex", | ||
"errorMsg": "Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.", | ||
"pattern": "^[a-zA-Z]\\w*$" | ||
} | ||
], | ||
"field": "name", | ||
"help": "Enter a unique name for this account.", | ||
"required": true | ||
} | ||
], | ||
"title": "Account" | ||
} | ||
], | ||
"title": "Configuration", | ||
"description": "Set up your add-on" | ||
}, | ||
"inputs": { | ||
"title": "Status toggle confirmation test", | ||
"services": [ | ||
{ | ||
"name": "example_input_one", | ||
"title": "Input one status toggle confirmation test", | ||
"entity": [ | ||
{ | ||
"type": "text", | ||
"label": "Name", | ||
"field": "name" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "example_input_two", | ||
"title": "Input two status toggle confirmation test", | ||
"entity": [ | ||
{ | ||
"type": "text", | ||
"label": "Name", | ||
"field": "name" | ||
} | ||
] | ||
} | ||
], | ||
"table": { | ||
"actions": ["edit", "delete", "clone"], | ||
"header": [ | ||
{ | ||
"label": "Name", | ||
"field": "name" | ||
} | ||
] | ||
}, | ||
"useInputToggleConfirmation": true | ||
} | ||
}, | ||
"meta": { | ||
"name": "Splunk_TA_UCCExample", | ||
"restRoot": "splunk_ta_uccexample", | ||
"version": "5.39.0Ra9e840a6", | ||
"displayName": "Splunk UCC test Add-on", | ||
"schemaVersion": "0.0.3", | ||
"_uccVersion": "5.39.0" | ||
} | ||
} |