diff --git a/devices/test/base.py b/devices/test/base.py index 66e64ea9a8669713f672db2088344d96a17f6e7c..1c2eff09be8e6a4034a476173944c8ec2a1fe61c 100644 --- a/devices/test/base.py +++ b/devices/test/base.py @@ -31,7 +31,7 @@ class TestCase(BaseTestCase): super().setUp() -class AsyncTestCase(BaseTestCase): +class AsyncTestCase(testscenarios.WithScenarios, asynctest.TestCase): """Test case base class for all asyncio unit tests.""" def setUp(self): diff --git a/devices/test/clients/test_opcua_client.py b/devices/test/clients/test_opcua_client.py index 6315abb20547cb35233b9b47f8f8c32414b1159e..bc13dc5e1d1d04c800e35f113825015b38779cd9 100644 --- a/devices/test/clients/test_opcua_client.py +++ b/devices/test/clients/test_opcua_client.py @@ -70,7 +70,7 @@ class TestOPCua(base.AsyncTestCase): @asynctest.patch.object(OPCUAConnection, "ping") @asynctest.patch.object(opcua_client, "Client") - @mock.patch.object(opcua_client, 'ProtocolAttribute') + @asynctest.patch.object(opcua_client, 'ProtocolAttribute') async def test_opcua_attr_setup(self, m_protocol_attr, m_opc_client, m_ping): """ This tests covers the correct creation of read/write functions. @@ -238,9 +238,9 @@ class TestOPCua(base.AsyncTestCase): # create the protocolattribute if len(j) == 1: - test = opcua_client.ProtocolAttribute(m_node, j[0], 0, opcua_client.numpy_to_OPCua_dict[i.numpy_type], self.loop) + test = opcua_client.ProtocolAttribute(m_node, j[0], 0, opcua_client.numpy_to_OPCua_dict[i.numpy_type]) else: - test = opcua_client.ProtocolAttribute(m_node, j[1], j[0], opcua_client.numpy_to_OPCua_dict[i.numpy_type], self.loop) + test = opcua_client.ProtocolAttribute(m_node, j[1], j[0], opcua_client.numpy_to_OPCua_dict[i.numpy_type]) # comparison function that replaces `set_data_value` inside the attributes write function async def compare_values(val): diff --git a/devices/test/common/test_lofar_logging.py b/devices/test/common/test_lofar_logging.py index 534b2650c8d432ef7c7dae9e32448b01cc5913f3..98222563f33167e62db9385090e1738aa29b6b24 100644 --- a/devices/test/common/test_lofar_logging.py +++ b/devices/test/common/test_lofar_logging.py @@ -75,7 +75,7 @@ class TestLofarLogging(base.TestCase): # create a Tango Device that logs something class MyDevice(Device): - def __init__(self): + def init_device(self): self.log_deeper_in_stack() def log_deeper_in_stack(self): @@ -83,7 +83,7 @@ class TestLofarLogging(base.TestCase): with mock.patch.object(device_server.DeviceImpl, '__info_stream') as m_info_stream: # logs in the constructor already - mydevice = MyDevice() + mydevice = MyDevice(None, "MyDeviceName") self.assertEqual(mydevice, self.memory_handler.records[0].tango_device, msg="configure_logging did not detect active Tango device") self.assertEqual(1, m_info_stream.call_count, msg="configure_logger did not send logs to active Tango device")