Exemplo n.º 1
0
def test_stuff():
    dev = FakeDevice()

    sys.argv = ["test"]
    tl.init_logger(dev)

    sys.argv = ["test", "test", "-v"]
    tl.init_logger(dev)
    tl.set_level(tango.LogLevel.LOG_DEBUG)

    assert tl.to_tango_level(logging.INFO) == tango.LogLevel.LOG_INFO
    assert tl.to_python_level(tango.LogLevel.LOG_INFO) == logging.INFO

    log = tl.get_logger()
    assert log is dev.get_logger()
    log.info(MSG)
    dev.info_stream(MSG)
Exemplo n.º 2
0
"""SDP Master device tests."""

import tango

from pytest_bdd import given, parsers, scenarios, then, when

from ska_sdp_lmc import HealthState, base_config, tango_logging
from .device_utils import init_device, update_attributes, wait_for_state, LOG_LIST

DEVICE_NAME = "test_sdp/elt/master"
CONFIG_DB_CLIENT = base_config.new_config_db_client()
LOG = tango_logging.get_logger()

# -------------------------------
# Get scenarios from feature file
# -------------------------------

scenarios("features/master.feature")

# -----------
# Given steps
# -----------


@given("I have an SDPMaster device", target_fixture="master_device")
def master_device(devices):
    """
    Get the SDPMaster device proxy.

    :param devices: the devices in a MultiDeviceTestContext
Exemplo n.º 3
0
 def get_logger(self) -> logging.Logger:
     return tl.get_logger()
Exemplo n.º 4
0
from ska_sdp_config.config import Transaction

# Note that relative imports are incompatible with main.
from ska_sdp_lmc.tango_logging import get_logger, init_logger, log_transaction_id
from ska_sdp_lmc.attributes import AdminMode, HealthState, ObsState
from ska_sdp_lmc.base import SDPDevice
from ska_sdp_lmc.commands import command_transaction
from ska_sdp_lmc.subarray_config import SubarrayConfig
from ska_sdp_lmc.subarray_validation import (
    validate_assign_resources,
    validate_configure,
    validate_scan,
)
from ska_sdp_lmc.util import terminate, check_args

LOG = get_logger()


class SDPSubarray(SDPDevice):
    """SDP Subarray device class."""

    # pylint: disable=invalid-name
    # pylint: disable=attribute-defined-outside-init
    # pylint: disable=too-many-public-methods

    # ----------
    # Attributes
    # ----------

    obsState = attribute(
        label="Observing state",