Commit 5a209d18 authored by Marco Buttu's avatar Marco Buttu
Browse files

Do nothing in case of MNG_BEAMPARK axis

parent c7a9def5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -149,6 +149,8 @@ class Positioner(object):
                raise NotAllowedError('positioner not configured: a setup() is required')
            elif not self.conf.isConfigured():
                raise NotAllowedError('CDB not configured: a CDBConf.setConfiguration() is required')
            elif axis == 'MNG_BEAMPARK':
                pass # Do nothing
            elif self.conf.getAttribute('DynamicUpdatingAllowed') != 'true':
                logger.logNotice('dynamic updating not allowed')
            elif not self.siteInfo:
+15 −0
Original line number Diff line number Diff line
@@ -57,6 +57,21 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
        finally:
            self.p.stopUpdating()
 
    def test_do_nothing_with_axis_MNG_BEAMPARK(self):
        """Do nothing in case the axis is MNG_BEAMPARK"""
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('CUSTOM')
        latitude, az, el = [radians(50)] * 3
        site_info = {'latitude': latitude}

        self.p.setup(site_info, self.source, self.device)
        try:
            self.p.startUpdating('MNG_BEAMPARK', 'ANT_NORTH', az, el)
            time.sleep(0.2)
            self.assertFalse(self.p.isUpdating())
        finally:
            self.p.stopUpdating()

    def test_notYetConfigured(self):
        """Verify startUpdating()"""
        # startUpdating() raises NotAllowedError when the system is not configured