MockScriptEngine¶
- class lsst.ts.m2com.MockScriptEngine¶
Bases:
object
Mock script engine class to simulate the execution of binary script.
Attributes¶
- is_running
bool
The script is running or not.
- percentage
int
orfloat
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¶
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¶
- steps
int
orfloat
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].
- steps
- set_name(name: str) None ¶
Set the script name.
Parameters¶
- name
str
Script name.
Raises¶
ValueError
When the script name is empty.
RuntimeError
When the script is running.
- name
- stop() None ¶
Stop the script.
- is_running