test_list

Tests for list macros

Classes

LsTest

Inheritance diagram of 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 by SarDemoEnv 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

LsmTest

Inheritance diagram of LsmTest
class LsmTest(*a, **kw)[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'

LspmTest

Inheritance diagram of LspmTest
class LspmTest(*a, **kw)[source]

Class used for testing the ‘lspm’ macro. It verifies that all pseudomotors created by sar_demo are listed after execution of the macro ‘lspm’.

macro_name = 'lspm'
elem_type = 'pseudomotor'

LsctrlTest

Inheritance diagram of LsctrlTest
class LsctrlTest(*a, **kw)[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'

LsctTest

Inheritance diagram of LsctTest
class LsctTest(*a, **kw)[source]

Class used for testing the ‘lsct’ macro. It verifies that all ct created by sar_demo are listed after execution of the macro ‘lsct’.

macro_name = 'lsct'
elem_type = 'ctexpchannel'

Ls0dTest

Inheritance diagram of Ls0dTest
class Ls0dTest(*a, **kw)[source]

Class used for testing the ‘ls0d’ macro. It verifies that all 0d created by sar_demo are listed after execution of the macro ‘ls0d’.

macro_name = 'ls0d'
elem_type = 'zerodexpchannel'

Ls1dTest

Inheritance diagram of Ls1dTest
class Ls1dTest(*a, **kw)[source]

Class used for testing the ‘ls1d’ macro. It verifies that all 1d created by sar_demo are listed after execution of the macro ‘ls1d’.

macro_name = 'ls1d'
elem_type = 'onedexpchannel'

Ls2dTest

Inheritance diagram of Ls2dTest
class Ls2dTest(*a, **kw)[source]

Class used for testing the ‘ls2d’ macro. It verifies that all 2d created by sar_demo are listed after execution of the macro ‘ls2d’.

macro_name = 'ls2d'
elem_type = 'twodexpchannel'