MockScriptEngine¶
- class lsst.ts.m2com.MockScriptEngine¶
Bases:
objectMock script engine class to simulate the execution of binary script.
Attributes¶
- is_running
bool The script is running or not.
- percentage
intorfloat 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
- pause() None¶
Pause the script.
- run() None¶
Run the script.
Raises¶
RuntimeErrorWhen the script name is empty.
RuntimeErrorWhen the script is running.
RuntimeErrorWhen 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¶
- steps
intorfloat Steps to run. The value should be between 0 and 100.
Raises¶
RuntimeErrorWhen the script engine is not running.
ValueErrorWhen the value of steps is not in [0, 100].
- steps
- set_name(name: str) None¶
Set the script name.
Parameters¶
- name
str Script name.
Raises¶
ValueErrorWhen the script name is empty.
RuntimeErrorWhen the script is running.
- name
- stop() None¶
Stop the script.
- is_running