Skip to content

Commit

Permalink
test: add test for generate function
Browse files Browse the repository at this point in the history
  • Loading branch information
artemrys committed Jun 8, 2021
1 parent 721f743 commit 3b426a4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
1 change: 1 addition & 0 deletions docs/how_to_use.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Prerequisites

* :code:`globalConfig.json`
* :code:`package` folder
* :code:`git` for automatic versioning (when no :code:`ta-version` argument is specified)

Example of :code:`globalConfig.json` and :code:`package` folder can be found at https://github.com/splunk/splunk-add-on-for-ucc-example.

Expand Down
34 changes: 16 additions & 18 deletions tests/data/globalConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
"help": "This is an example radio button for the account entity",
"required": true,
"options": {
"items": [{
"items": [
{
"value": "yes",
"label": "Yes"
},
Expand All @@ -113,7 +114,8 @@
"help": "This is an example multipleSelect for account entity",
"required": true,
"options": {
"items": [{
"items": [
{
"value": "one",
"label": "Option One"
},
Expand All @@ -124,15 +126,6 @@
]
}
},
{
"type": "text",
"label": "State",
"help": "This is a boolean field for developers to decide whether state parameter will be passed in the OAuth flow. Value: true|false",
"field": "oauth_state_enabled",
"options": {
"display": false
}
},
{
"type": "oauth",
"field": "oauth",
Expand Down Expand Up @@ -187,7 +180,8 @@
],
"auth_code_endpoint": "/services/oauth2/authorize",
"access_token_endpoint": "/services/oauth2/token",
"oauth_timeout": 30
"oauth_timeout": 30,
"oauth_state_enabled": false
}
},
{
Expand Down Expand Up @@ -465,7 +459,8 @@
"help": "This is an example radio button for the input one entity",
"required": false,
"options": {
"items": [{
"items": [
{
"value": "yes",
"label": "Yes"
},
Expand Down Expand Up @@ -759,7 +754,8 @@
"help": "This is an example multipleSelect for input two entity",
"required": true,
"options": {
"items": [{
"items": [
{
"value": "one",
"label": "Option One"
},
Expand All @@ -784,7 +780,8 @@
"help": "This is an example radio button for the input two entity",
"required": false,
"options": {
"items": [{
"items": [
{
"value": "yes",
"label": "Yes"
},
Expand Down Expand Up @@ -1029,7 +1026,8 @@
"apiVersion": "3.2.0",
"name": "Splunk_TA_UCCExample",
"restRoot": "splunk_ta_uccexample",
"version": "1.0.0",
"displayName": "Splunk UCC test Add-on"
"version": "5.0.0de0f47df5",
"displayName": "Splunk UCC test Add-on",
"schemaVersion": "0.0.2"
}
}
}
14 changes: 14 additions & 0 deletions tests/data/test_ucc_generate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from os import path
import unittest

import splunk_add_on_ucc_framework as ucc


class UccGenerateTest(unittest.TestCase):
def test_ucc_generate_without_arguments(self):
package_folder = path.join(path.dirname(path.realpath(__file__)), "package")
ucc.generate(source=package_folder)


if __name__ == "__main__":
unittest.main()

0 comments on commit 3b426a4

Please sign in to comment.