test_list¶
Tests for list macros
Classes
LsTest¶
-
class
LsTest[source]¶ Base class for testing macros used to list elements. See
RunMacroTestCasefor requirements. LsTest use the lists of elem_type generated bySarDemoEnvas reference for compare with the output of the tested ls macro.- LsTest provide the class member:
- elem_type (str): Type of the element to validate (mandatory).
- Must be a valid type for
SarDemoEnvclass.
- It provides the helper method:
-
elem_type= None¶
-
check_elements(list1, list2)[source]¶ A helper method to evaluate if all elements of list1 are in list2. :params list1: (seq<str>) List of elements to evaluate. :params list2: (seq<str>) List of elements for validate.
-
macro_runs(**kwargs)[source]¶ Reimplementation of macro_runs method for ls macros. It verifies that elements (elem_type) gotten by parsing the macro executor log output are in the correspondent list (elem_type) of SardanaEnv.
-
assertFinished(msg)¶ Asserts that macro has finished.
-
door_name= 'door/demo1/1'¶
-
macro_fails(macro_name=None, macro_params=None, wait_timeout=inf, exception=None)¶ Check that the macro fails to run for the given input parameters
Parameters: - macro_name – (str) macro name (takes precedence over macro_name class member)
- macro_params – (seq<str>) input parameters for the macro
- wait_timeout – maximum allowed time for the macro to fail. By default infinite timeout is used.
- exception – (str or Exception) if given, an additional check of the type of the exception is done. (IMPORTANT: this is just a comparison of str representations of exception objects)
-
macro_name= None¶
-
setUp()¶ Preconditions: - Those from
BaseMacroTestCase- the macro executor registers to all the log levels
-
tearDown()¶ The macro_executor instance must be removed
LsmTest¶
-
class
LsmTest(methodName='runTest')[source]¶ Class used for testing the ‘lsm’ macro. It verifies that all motors created by sar_demo are listed after execution of the macro ‘lsm’.
-
macro_name= 'lsm'¶
-
elem_type= 'moveable'¶
-
test_lsm_macro_runs(obj)¶ Testing lsm with macro_runs()
-
test_lsm_macro_runs_2(obj)¶ Testing lsm with macro_runs(macro_params=[‘l.*’])
-
LspmTest¶
LsctrlTest¶
-
class
LsctrlTest(methodName='runTest')[source]¶ Class used for testing the ‘lsctrl’ macro. It verifies that all controllers created by sar_demo are listed after execution of the macro ‘lsctrl’.
-
macro_name= 'lsctrl'¶
-
elem_type= 'controller'¶
-
test_lsctrl_macro_runs(obj)¶ Testing lsctrl with macro_runs()
-
LsctTest¶
Ls0dTest¶
Ls1dTest¶