77# Admin Test - Test to exectute various calls for the Administrator
88# parts of the Kepware configuration API
99
10+ from wsgiref .simple_server import server_version
1011from kepconfig .error import KepError , KepHTTPError
1112import os , sys
1213from typing import Dict , List
1314import pytest
1415sys .path .append (os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
15- # import kepconfig
16+ import kepconfig
1617from kepconfig import admin
1718import json
1819import time
2829twx_agent_name = 'Thingworx'
2930iot_item_name = "System__Date"
3031
32+
33+
3134group1 = {'common.ALLTYPES_NAME' : 'Operators' }
3235group2 = {'common.ALLTYPES_NAME' : 'Group1' }
3336group3 = {'common.ALLTYPES_NAME' : 'Group2' }
@@ -89,8 +92,10 @@ def complete(server):
8992
9093
9194@pytest .fixture (scope = "module" )
92- def server (kepware_server ):
93- server = kepware_server
95+ def server (kepware_server : list [kepconfig .connection .server , str ]):
96+ server = kepware_server [0 ]
97+ global server_type
98+ server_type = kepware_server [1 ]
9499
95100 # Initialize any configuration before testing in module
96101 initialize (server )
@@ -100,10 +105,7 @@ def server(kepware_server):
100105 complete (server )
101106
102107def test_uaserver (server ):
103- try :
104- server ._config_get (server .url + admin .ua_server ._create_url ())
105- except Exception as err :
106- pytest .skip ("UA Endpoints not configurable." )
108+ if server_type == 'TKS' : pytest .skip ("UA Endpoints not configurable in {}." .format (server_type ))
107109
108110 assert admin .ua_server .add_endpoint (server ,uaendpoint1 )
109111
0 commit comments