MockScriptEngine¶
- class lsst.ts.m2com.MockScriptEngine¶
Bases:
object
Mock script engine class to simulate the execution of binary script.
- Attributes:
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()¶
Clear the script.
- Raises:
RuntimeError
When the script is running.
- pause()¶
Pause the script.
- run()¶
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)¶
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:
- Raises:
RuntimeError
When the script engine is not running.
ValueError
When the value of steps is not in [0, 100].
- set_name(name)¶
Set the script name.
- Parameters:
- name
str
Script name.
- name
- Raises:
ValueError
When the script name is empty.
RuntimeError
When the script is running.
- stop()¶
Stop the script.