diff --git a/tangostationcontrol/requirements.txt b/tangostationcontrol/requirements.txt index a6662e4b263ca26aa93ad216c9b104ffd0e8e735..8d628544905096b9a717719b18bb25293bb0e72d 100644 --- a/tangostationcontrol/requirements.txt +++ b/tangostationcontrol/requirements.txt @@ -3,7 +3,7 @@ # integration process, which may cause wedges in the gate later. importlib-metadata<2.0.0,>=0.12;python_version<"3.8" -lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client@0.9.1 +lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client@0.9.2 numpy mock asyncua >= 0.9.90 # LGPLv3 diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_observation.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_observation.py new file mode 100644 index 0000000000000000000000000000000000000000..cb9011a00e0f3448a4a84a74d1fef8ac15178291 --- /dev/null +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_observation.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# +# This file is part of the LOFAR 2.0 Station Software +# +# +# +# Distributed under the terms of the APACHE license. +# See LICENSE.txt for more info. + +from tangostationcontrol.test.devices.test_observation_base import TestObservationBase +from tangostationcontrol.integration_test import base +from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy + +from lofar_station_client.observation.observation import Observation + +from os import environ +from json import loads + +from tango import DevState + +class TestObservation(base.IntegrationTestCase): + + def setUp(self): + self.observation_control_proxy = TestDeviceProxy("STAT/ObservationControl/1") + self.observation_control_proxy.off() + self.observation_control_proxy.warm_boot() + + def test_observation(self): + """Test of the observation_wrapper class basic functionality""" + + # convert the JSON specificiation to a dict for this class + specification_dict = loads(TestObservationBase.VALID_JSON) + + # create an observation class using the dict and as host just get it using a util function + observation = Observation(specification=specification_dict, host=environ["TANGO_HOST"]) + + # Assert the observation is running after starting it + observation.start() + self.assertTrue(observation.is_running()) + + # Assert the proxy is on + proxy = observation.observation_proxy() + self.assertTrue(proxy.state() == DevState.ON) + + # Assert the observation has stopped after aborting + observation.abort() + self.assertFalse(observation.is_running())