diff --git a/tangostationcontrol/tangostationcontrol/test/devices/test_recv_device.py b/tangostationcontrol/tangostationcontrol/test/devices/test_recv_device.py index f918f5e6552538a6cb02da60a18c62ac779272a5..db7cf6b76f77e2984f78699c4e280897807b89cb 100644 --- a/tangostationcontrol/tangostationcontrol/test/devices/test_recv_device.py +++ b/tangostationcontrol/tangostationcontrol/test/devices/test_recv_device.py @@ -8,11 +8,12 @@ # See LICENSE.txt for more info. from tango.test_context import DeviceTestContext -from tango import DeviceProxy +from tango import DeviceProxy, DevState from tangostationcontrol.devices import recv, lofar_device import mock +import numpy from tangostationcontrol.test import base @@ -34,8 +35,10 @@ class TestRecvDevice(base.TestCase): def init_device(self, proxy:DeviceProxy): proxy.off() proxy.initialise() + self.assertEqual(DevState.STANDBY, proxy.state()) proxy.set_defaults() proxy.on() + self.assertEqual(DevState.ON, proxy.state()) def test_get_hbat_bf_delay_step_delays(self): """Verify can read delay step attribute and length matches without err""" @@ -60,3 +63,11 @@ class TestRecvDevice(base.TestCase): with DeviceTestContext(recv.RECV, properties=self.recv_properties, process=True) as proxy: self.init_device(proxy) self.assertEqual(3072, len(proxy.get_hbat_signal_input_delays())) # 96x32=3072 + + def test_calculate_HBAT_bf_delays(self): + """Verify HBAT beamforming calculations are correctly executed""" + with DeviceTestContext(recv.RECV, properties=self.recv_properties, process=True) as proxy: + self.init_device(proxy) + delays = numpy.random.rand(96,16).flatten() + HBAT_bf_delays = proxy.calculate_HBAT_bf_delays(delays) + self.assertEqual(3072, len(HBAT_bf_delays)) # 96x32=3072