File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525twx_agent_name = 'Thingworx'
2626iot_item_name = "System__Date"
2727
28- agent_list = [
29- [mqtt_agent_name , kepconfig .iot_gateway .MQTT_CLIENT_AGENT ],
30- [rest_agent_name , kepconfig .iot_gateway .REST_CLIENT_AGENT ],
31- [rserver_agent_name , kepconfig .iot_gateway .REST_SERVER_AGENT ]
32- ]
28+ # used to test which agents are installed to test against.
29+ agent_list_avail = []
30+
31+ agent_list = []
3332
3433agent_data = {
3534 "common.ALLTYPES_NAME" : 'TempName' ,
@@ -71,8 +70,15 @@ def HTTPErrorHandler(err):
7170 else :
7271 print ('Different Exception Received: {}' .format (err ))
7372
74- def initialize (server ):
75- pass
73+ def initialize (server : kepconfig .connection .server ):
74+ try :
75+ agent_list_avail = server ._config_get (server .url + "/project/_iot_gateway?content=type_definition" ).payload
76+ for agent in agent_list_avail ['child_collections' ]:
77+ if agent == 'mqtt_clients' : agent_list .append ([mqtt_agent_name , kepconfig .iot_gateway .MQTT_CLIENT_AGENT ])
78+ if agent == 'rest_clients' : agent_list .append ([rest_agent_name , kepconfig .iot_gateway .REST_CLIENT_AGENT ])
79+ if agent == 'rest_servers' : agent_list .append ([rserver_agent_name , kepconfig .iot_gateway .REST_SERVER_AGENT ])
80+ except Exception as err :
81+ pytest .skip ("IoT gateway plug-in is not installed" , allow_module_level = True )
7682
7783def complete (server ):
7884 # Delete all Agents
You can’t perform that action at this time.
0 commit comments