BaseCscTestCase#

class lsst.ts.hexrotcomm.BaseCscTestCase#

Bases: BaseCscTestCase

A variant of salobj.BaseCscTestCase that captures all but the last controller state in make_csc.

Methods Summary

check_bin_script(name, index, exe_name[, ...])

Test running the CSC command line script.

make_csc([initial_state, config_dir, ...])

Create a CSC and remote and wait for them to start.

Methods Documentation

async check_bin_script(name, index, exe_name, cmdline_args=[])#

Test running the CSC command line script.

Parameters:
  • name (str) – Name of SAL component, e.g. “MTRotator”

  • index (int or None) – SAL index of component.

  • exe_name (str) – Name of executable, e.g. “run_rotator.py”

  • cmdline_args (List [str]) – Additional command-line arguments, such as “–simulate”.

Return type:

None

make_csc(initial_state=State.STANDBY, config_dir=None, simulation_mode=0, log_level=None, timeout=60, **kwargs)#

Create a CSC and remote and wait for them to start.

The csc is accessed as self.csc and the remote as self.remote.

This override reads and checks all but the last controllerState event during startup, in addition to the summaryState event.

Parameters:
  • name (str) – Name of SAL component.

  • initial_state (lsst.ts.salobj.State or int, optional) – The initial state of the CSC. Defaults to STANDBY.

  • config_dir (str, optional) – Directory of configuration files, or None (the default) for the standard configuration directory (obtained from ConfigureCsc._get_default_config_dir).

  • simulation_mode (int, optional) – Simulation mode. Defaults to 0 because not all CSCs support simulation. However, tests of CSCs that support simulation will almost certainly want to set this nonzero.

  • log_level (int or None, optional) – Logging level, such as logging.INFO. If None then do not set the log level, leaving the default behavior of SalInfo: increase the log level to INFO.

  • timeout (float) – Time limit for the CSC to start (seconds).

  • **kwargs (dict) – Extra keyword arguments for basic_make_csc. For a configurable CSC this may include override, especially if initial_state is DISABLED or ENABLED.

Return type:

BaseCsc

Notes

Adds a logging.StreamHandler if one is not already present.