Commit aee6aa64 authored by Marco Buttu's avatar Marco Buttu
Browse files

setLO raises a ComponentErrors::ComponentErrorsEx

parent 4ed29603
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -359,7 +359,8 @@ void SRTLPBandReceiverImpl::setLO(const ACS::doubleSeq& lo) throw (
        ComponentErrors::ComponentErrorsEx,
        ReceiversErrors::ReceiversErrorsEx)
{
    ; // Do nothing
    _EXCPT(ComponentErrors::NotAllowedExImpl, impl, "SRTLPBandReceiverImpl::setLO(): operation not allowed.");
    throw impl.getComponentErrorsEx();
}


+5 −3
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ from __future__ import with_statement

import unittest2
from Acspy.Clients.SimpleClient import PySimpleClient
from ComponentErrors import ComponentErrorsEx

class TestSetLO(unittest2.TestCase):

@@ -9,9 +10,10 @@ class TestSetLO(unittest2.TestCase):
        client = PySimpleClient()
        self.lp = client.getComponent('RECEIVERS/SRTLPBandReceiver')

    def test_do_not_raise_exception(self):
        """Do not raise any exception"""
        self.lp.setLO([0, 0]) # Do nothing
    def test_operation_not_allowed(self):
        """Raise an exception because the LBand has no local oscillator"""
        with self.assertRaises(ComponentErrorsEx):
            self.lp.setLO([0, 0])


if __name__ == '__main__':