Skip to content
Snippets Groups Projects
Commit 9f163e89 authored by Taya Snijder's avatar Taya Snijder
Browse files

Merge branch 'L2SS-825_start_an_observation' into 'master'

Resolve L2SS-825 "Start an observation"

Closes L2SS-825

See merge request !457
parents b599551e ab2979ac
No related branches found
No related tags found
1 merge request!457Resolve L2SS-825 "Start an observation"
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# integration process, which may cause wedges in the gate later. # integration process, which may cause wedges in the gate later.
importlib-metadata<2.0.0,>=0.12;python_version<"3.8" 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 numpy
mock mock
asyncua >= 0.9.90 # LGPLv3 asyncua >= 0.9.90 # LGPLv3
......
# -*- 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())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment