MockScriptEngine

class lsst.ts.m2com.MockScriptEngine

Bases: object

Mock script engine class to simulate the execution of binary script.

Attributes

is_runningbool

The script is running or not.

percentageint or float

Percentage of the running.

Methods Summary

clear()

Clear the script.

pause()

Pause the script.

run()

Run the script.

run_steps(steps)

Run the steps.

set_name(name)

Set the script name.

stop()

Stop the script.

Methods Documentation

clear() None

Clear the script.

Raises

RuntimeError

When the script is running.

pause() None

Pause the script.

run() None

Run the script.

Raises

RuntimeError

When the script name is empty.

RuntimeError

When the script is running.

RuntimeError

When the script is done.

run_steps(steps: int | float) None

Run the steps.

If the function executes successfully, the self.percentage will add the value of steps. The maximum value of self.percentage is 100, and the script is considered done. When this happens, the execution of this function will raise the error.

Parameters

stepsint or float

Steps to run. The value should be between 0 and 100.

Raises

RuntimeError

When the script engine is not running.

ValueError

When the value of steps is not in [0, 100].

set_name(name: str) None

Set the script name.

Parameters

namestr

Script name.

Raises

ValueError

When the script name is empty.

RuntimeError

When the script is running.

stop() None

Stop the script.