Commit 30b2c19f authored by oroulet's avatar oroulet

fix applicaiton_uri handling in tests

parent ccf78073
......@@ -268,7 +268,7 @@ class Client:
if discovery_configuration is provided, the newer register_server2 service call is used
"""
serv = ua.RegisteredServer()
serv.ServerUri = server.application_uri
serv.ServerUri = server.get_application_uri()
serv.ProductUri = server.product_uri
serv.DiscoveryUrls = [server.endpoint.geturl()]
serv.ServerType = server.application_type
......
......@@ -126,6 +126,9 @@ class Server:
"""
self.iserver.disabled_clock = val
def get_application_uri(self):
return self._application_uri
async def set_application_uri(self, uri: str):
"""
Set application/server URI.
......
......@@ -23,7 +23,7 @@ async def test_discovery(server, discovery_server):
async with client:
servers = await client.find_servers()
new_app_uri = 'urn:freeopcua:python:server:test_discovery'
server.application_uri = new_app_uri
await server.set_application_uri(new_app_uri)
await server.register_to_discovery(discovery_server.endpoint.geturl(), 0)
# let server register registration
await asyncio.sleep(0.1)
......@@ -38,10 +38,10 @@ async def test_find_servers2(server, discovery_server):
async with client:
servers = await client.find_servers()
new_app_uri1 = 'urn:freeopcua:python:server:test_discovery1'
server.application_uri = new_app_uri1
await server.set_application_uri(new_app_uri1)
await server.register_to_discovery(discovery_server.endpoint.geturl(), period=0)
new_app_uri2 = 'urn:freeopcua:python:test_discovery2'
server.application_uri = new_app_uri2
await server.set_application_uri(new_app_uri2)
await server.register_to_discovery(discovery_server.endpoint.geturl(), period=0)
await asyncio.sleep(0.1) # let server register registration
new_servers = await client.find_servers()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment