diff --git a/tangostationcontrol/tangostationcontrol/devices/beam.py b/tangostationcontrol/tangostationcontrol/devices/beam.py index b27e21c8a094ee12e1864b4b2ba25be7670b4e80..e4a85594a0cb9efeb18e0e3eea2d8779814d9197 100644 --- a/tangostationcontrol/tangostationcontrol/devices/beam.py +++ b/tangostationcontrol/tangostationcontrol/devices/beam.py @@ -59,8 +59,6 @@ class Beam(lofar_device): dtype=(numpy.double,), max_dim_x=96, fget=lambda self: self._hbat_pointing_timestamp) - RECV_name = 'stat/recv/1' - # Directory where the casacore measures that we use, reside. We configure ~/.casarc to # use the symlink /opt/IERS/current, which we switch to the actual set of files to use. measures_directory_R = attribute(dtype=str, access=AttrWriteType.READ, fget = lambda self: get_measures_directory()) @@ -73,13 +71,11 @@ class Beam(lofar_device): # -------- @log_exceptions() def configure_for_initialise(self): - # Set a reference of RECV device - try: - self.recv_proxy = DeviceProxy(self.RECV_name) - except: - logger.warning("RECV device offline") # avoid error raising in unittest super().configure_for_initialise() + # Set a reference of RECV device + self.recv_proxy = DeviceProxy("STAT/RECV/1") + # -------- # internal functions # -------- diff --git a/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py b/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py index 2aa26e1b4a27ab950ca2b5b00c8c77a20950fc38..74bdf3eec9a7e01d541ae53eed391114f00bee41 100644 --- a/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py +++ b/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py @@ -31,6 +31,13 @@ class TestBeamDevice(base.TestCase): beam.Beam, 'init_device', spec=beam.Beam.init_device) self.m_init = init_patcher.start() self.addCleanup(init_patcher.stop) + + # Patch DeviceProxy to allow making the proxies during initialisation + # that we otherwise avoid using + proxy_patcher = mock.patch.object( + beam, 'DeviceProxy') + self.m_init = proxy_patcher.start() + self.addCleanup(proxy_patcher.stop) def test_get_pointing_directions(self): """Verify can read pointings attribute and length matches without err"""