Skip to content
Snippets Groups Projects
Select Git revision
  • 0e5bbd6f2bdad25828b242b4231a8ad66840bca7
  • master default protected
  • L2SS-2199-apply-dab-to-xy
  • L2SS-2417-more-vector-memory
  • test-pytango-10.0.3
  • revert-cs032-ccd-ip
  • deploy-components-parallel
  • fix-chrony-exporter
  • L2SS-2407-swap-iers-caltable-monitoring-port
  • L2SS-2357-fix-ruff
  • sync-up-with-meta-pypcc
  • stabilise-landing-page
  • all-stations-lofar2
  • v0.39.7-backports
  • Move-sdptr-to-v1.5.0
  • fix-build-ubuntu
  • tokens-in-env-files
  • fix-build
  • L2SS-2214-deploy-cdb
  • fix-missing-init
  • add-power-hardware-apply
  • v0.55.5-r2 protected
  • v0.52.8-rc1 protected
  • v0.55.5 protected
  • v0.55.4 protected
  • 0.55.2.dev0
  • 0.55.1.dev0
  • 0.55.0.dev0
  • v0.54.0 protected
  • 0.53.2.dev0
  • 0.53.1.dev0
  • v0.52.3-r2 protected
  • remove-snmp-client
  • v0.52.3 protected
  • v0.52.3dev0 protected
  • 0.53.1dev0
  • v0.52.2-rc3 protected
  • v0.52.2-rc2 protected
  • v0.52.2-rc1 protected
  • v0.52.1.1 protected
  • v0.52.1 protected
41 results

installation.rst

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    PCC_test.py 3.19 KiB
    #########################################################################################
    # -*- coding: utf-8 -*-
    #
    # This file is part of the PCC project
    #
    #
    #
    # Distributed under the terms of the APACHE license.
    # See LICENSE.txt for more info.
    #########################################################################################
    """Contain the tests for the RCU-SCC Device Server for LOFAR2.0."""
    
    # Path
    import sys
    import os
    path = os.path.join(os.path.dirname(__file__), os.pardir)
    sys.path.insert(0, os.path.abspath(path))
    
    # Imports
    import pytest
    from mock import MagicMock
    
    from PyTango import DevState
    
    # PROTECTED REGION ID(PCC.test_additional_imports) ENABLED START #
    # PROTECTED REGION END #    //  PCC.test_additional_imports
    
    
    # Device test case
    @pytest.mark.usefixtures("tango_context", "initialize_device")
    # PROTECTED REGION ID(PCC.test_PCC_decorators) ENABLED START #
    # PROTECTED REGION END #    //  PCC.test_PCC_decorators
    class TestPCC(object):
        """Test case for packet generation."""
    
        properties = {
            'OPC_Server_Name': '',
            'OPC_Server_Port': '',
            'OPC_Time_Out': '',
            }
    
        @classmethod
        def mocking(cls):
            """Mock external libraries."""
            # Example : Mock numpy
            # cls.numpy = PCC.numpy = MagicMock()
            # PROTECTED REGION ID(PCC.test_mocking) ENABLED START #
            # PROTECTED REGION END #    //  PCC.test_mocking
    
        def test_properties(self, tango_context):
            # Test the properties
            # PROTECTED REGION ID(PCC.test_properties) ENABLED START #
            # PROTECTED REGION END #    //  PCC.test_properties
            pass
    
        # PROTECTED REGION ID(PCC.test_State_decorators) ENABLED START #
        # PROTECTED REGION END #    //  PCC.test_State_decorators
        def test_State(self, tango_context):
            """Test for State"""
            # PROTECTED REGION ID(PCC.test_State) ENABLED START #
            assert tango_context.device.State() == DevState.UNKNOWN
            # PROTECTED REGION END #    //  PCC.test_State
    
        # PROTECTED REGION ID(PCC.test_Status_decorators) ENABLED START #
        # PROTECTED REGION END #    //  PCC.test_Status_decorators
        def test_Status(self, tango_context):
            """Test for Status"""
            # PROTECTED REGION ID(PCC.test_Status) ENABLED START #
            assert tango_context.device.Status() == "The device is in UNKNOWN state."
            # PROTECTED REGION END #    //  PCC.test_Status
    
    
        # PROTECTED REGION ID(PCC.test_time_offset_rw_decorators) ENABLED START #
        # PROTECTED REGION END #    //  PCC.test_time_offset_rw_decorators
        def test_time_offset_rw(self, tango_context):
            """Test for time_offset_rw"""
            # PROTECTED REGION ID(PCC.test_time_offset_rw) ENABLED START #
            assert tango_context.device.time_offset_rw == 0
            # PROTECTED REGION END #    //  PCC.test_time_offset_rw
    
        # PROTECTED REGION ID(PCC.test_time_offset_r_decorators) ENABLED START #
        # PROTECTED REGION END #    //  PCC.test_time_offset_r_decorators
        def test_time_offset_r(self, tango_context):
            """Test for time_offset_r"""
            # PROTECTED REGION ID(PCC.test_time_offset_r) ENABLED START #
            assert tango_context.device.time_offset_r == 0
            # PROTECTED REGION END #    //  PCC.test_time_offset_r