test_list
¶
Tests for list macros
Classes
LsTest¶
-
class
LsTest
[source]¶ Base class for testing macros used to list elements. See
RunMacroTestCase
for requirements. LsTest use the lists of elem_type generated bySarDemoEnv
as 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
SarDemoEnv
class.
- 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