Skip to content
Snippets Groups Projects
Commit 84e3a46f authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

L2SS-1030: restore integration test

parent dd6e0a2c
No related branches found
No related tags found
1 merge request!468Resolve L2SS-1030 "Create configuration device"
# -*- 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 tango import DevState
from .base import AbstractTestBases
import json
class TestDeviceConfiguration(AbstractTestBases.TestDeviceBase):
def setUp(self):
super().setUp("STAT/Configuration/1")
def test_read_tangodb_properties(self):
self.proxy.warm_boot()
self.assertEqual(DevState.ON, self.proxy.state())
""" Test whether the station control configuration is correctly retrieved as a JSON string """
tangodb_properties = self.proxy.tangodb_properties_RW
dbdata = json.loads(tangodb_properties)
self.assertTrue(type(dbdata), dict)
self.assertGreater(len(dbdata['servers']), 0)
# Verify if Configuration Device exists
self.assertTrue('configuration' in dbdata['servers']) # server-name
self.assertTrue('stat' in dbdata['servers']['configuration']) # server-instance
self.assertTrue('configuration' in dbdata['servers']['configuration']['stat']) # server-class
self.assertTrue('stat/configuration/1' in dbdata['servers']['configuration']['stat']['configuration']) # device
# -*- 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 tango import DevState
from tango.test_context import DeviceTestContext
from tangostationcontrol.devices import configuration_device
from tangostationcontrol.test import base
import json
class TestConfigurationDevice(base.TestCase):
def setUp(self):
super(TestConfigurationDevice, self).setUp()
def test_read_tangodb_properties(self):
with DeviceTestContext(configuration_device.Configuration, properties={}, process=True) as proxy:
proxy.warm_boot()
self.assertEqual(DevState.ON, proxy.state())
""" Test whether the station control configuration is correctly retrieved as a JSON string """
tangodb_properties = self.proxy.tangodb_properties_RW
dbdata = json.loads(tangodb_properties)
self.assertTrue(type(dbdata), dict)
self.assertGreater(len(dbdata['servers']), 0)
# Verify if Configuration Device exists
self.assertTrue('configuration' in dbdata['servers']) # server-name
self.assertTrue('stat' in dbdata['servers']['configuration']) # server-instance
self.assertTrue('configuration' in dbdata['servers']['configuration']['stat']) # server-class
self.assertTrue('stat/configuration/1' in dbdata['servers']['configuration']['stat']['configuration']) # device
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment