From 685431c9849f43d2c4fbf2521550d01f26d7bd0b Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Wed, 6 Oct 2021 19:30:30 +0200 Subject: [PATCH] L2SS-412: Migrate integration tests to asyncua and asynctest --- devices/integration_test/client/test_sdptr_sim.py | 12 ++++++------ devices/integration_test/client/test_unb2_sim.py | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/devices/integration_test/client/test_sdptr_sim.py b/devices/integration_test/client/test_sdptr_sim.py index 3ba48e7d7..0ee898ad7 100644 --- a/devices/integration_test/client/test_sdptr_sim.py +++ b/devices/integration_test/client/test_sdptr_sim.py @@ -7,26 +7,26 @@ # Distributed under the terms of the APACHE license. # See LICENSE.txt for more info. -from opcua import Client +from asyncua import Client from integration_test import base -class TestSDPTRSim(base.IntegrationTestCase): +class TestSDPTRSim(base.IntegrationAsyncTestCase): def setUp(self): super(TestSDPTRSim, self).setUp() - def test_opcua_connection(self): + async def test_opcua_connection(self): """Check if we can connect to sdptr-sim""" client = Client("opc.tcp://sdptr-sim:4840") root_node = None try: - client.connect() - root_node = client.get_root_node() + await client.connect() + root_node = await client.get_root_node() finally: - client.disconnect() + await client.disconnect() self.assertNotEqual(None, root_node) diff --git a/devices/integration_test/client/test_unb2_sim.py b/devices/integration_test/client/test_unb2_sim.py index 227e031e3..0587a2509 100644 --- a/devices/integration_test/client/test_unb2_sim.py +++ b/devices/integration_test/client/test_unb2_sim.py @@ -7,27 +7,27 @@ # Distributed under the terms of the APACHE license. # See LICENSE.txt for more info. -from opcua import Client +from asyncua import Client from integration_test import base -class TestUNB2Sim(base.IntegrationTestCase): +class TestUNB2Sim(base.IntegrationAsyncTestCase): def setUp(self): super(TestUNB2Sim, self).setUp() - def test_opcua_connection(self): + async def test_opcua_connection(self): """Check if we can connect to unb2-sim""" client = Client("opc.tcp://unb2-sim:4844") root_node = None - client.connect() + await client.connect() try: - root_node = client.get_root_node() + root_node = await client.get_root_node() finally: - client.disconnect() + await client.disconnect() self.assertNotEqual(None, root_node) -- GitLab