Loading Common/Servers/DewarPositioner/src/DewarPositioner/positioner.py +2 −0 Original line number Diff line number Diff line Loading @@ -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: Loading Common/Servers/DewarPositioner/test/pyunit/positioner/test_startUpdating.py +15 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
Common/Servers/DewarPositioner/src/DewarPositioner/positioner.py +2 −0 Original line number Diff line number Diff line Loading @@ -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: Loading
Common/Servers/DewarPositioner/test/pyunit/positioner/test_startUpdating.py +15 −0 Original line number Diff line number Diff line Loading @@ -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 Loading