-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathplugin_service_test.py
More file actions
62 lines (51 loc) · 1.79 KB
/
plugin_service_test.py
File metadata and controls
62 lines (51 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from spiffworkflow_proxy.plugin_service import PluginService
"""Connector_example is a Dev dependency and should be picked
up by these tests. """
def test_find_dependencies() -> None:
assert(list(PluginService.available_plugins().keys()) == ['connector_example'])
def test_display_name() -> None:
assert(PluginService.plugin_display_name('connector_example') == "example")
def test_plugin_for_display_name() -> None:
assert(PluginService.plugin_name_from_display_name('example') == "connector_example")
def test_available_commands_by_plugin() -> None:
commands = PluginService.available_commands_by_plugin()
assert(list(commands['connector_example'].keys()) == ['CombineStrings'])
def test_describe_target() -> None:
commands = PluginService.available_commands_by_plugin()
combine_strings = commands["connector_example"]["CombineStrings"]
description = PluginService.describe_target(
"connector_example", "CombineStrings", combine_strings
)
assert description == {
"id": "example/CombineStrings",
"parameters": [
{
"id": "arg1",
"required": True,
"type": "str",
},
{
"id": "arg2",
"required": False,
"type": "str",
}
],
"schema": {
"title": "Parameters",
"type": "object",
"required": [
"arg1"
],
"properties": {
"arg1": {
"title": "arg1",
"type": ["string"]
},
"arg2": {
"title": "arg2",
"type": ["string"],
"default": "foo"
}
}
}
}