mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry Class Reference

## Public Member Functions

def | print_error (self, text)
| Prints error directly on console. More...
def | register_plugin (self, plugin)
| Registers and stores plugin inside registry for further use. More...
def | call_plugin (self, type, capability, *args, **kwargs)
| Execute plugin functionality respectively to its purpose. More...
def | get_plugin_caps (self, type)
| Returns list of all capabilities for plugin family with the same type. More...
def | load_plugin (self, name)
| Used to load module from system (by import) More...
def | get_string (self)
| User friendly printing method to show hooked plugins. More...
def | get_dict (self)
def | __str__ (self)

## Static Public Attributes

dictionary | PLUGINS = {}

## Detailed Description

     Simple class used to register and store
        host test plugins for further usage

Definition at line 20 of file host_test_registry.py.

## Member Function Documentation

## __str__()

def mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry.__str__ | ( |  | self | ) |

Definition at line 132 of file host_test_registry.py.

## call_plugin()

def mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry.call_plugin | ( |  | self,
|  |  | type,
|  |  | capability,
|  | * | args,
|  | ** | kwargs
| ) |  |

Execute plugin functionality respectively to its purpose.

Parameters

  type | Plugin type
  capability | Plugin capability name
  args | Additional plugin parameters
  kwargs | Additional plugin parameters

Returns
  Returns result from plugin's execute() method

Definition at line 58 of file host_test_registry.py.

## get_dict()

def mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry.get_dict | ( |  | self | ) |

Definition at line 112 of file host_test_registry.py.

## get_plugin_caps()

def mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry.get_plugin_caps | ( |  | self,
|  |  | type
| ) |  |

Returns list of all capabilities for plugin family with the same type.

Parameters

  type | Plugin type

Returns
  Returns list of capabilities for plugin. If there are no capabilities empty list is returned

Definition at line 72 of file host_test_registry.py.

## get_string()

def mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry.get_string | ( |  | self | ) |

User friendly printing method to show hooked plugins.

Returns
  Returns string formatted with PrettyTable

Definition at line 92 of file host_test_registry.py.

## load_plugin()

def mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry.load_plugin | ( |  | self,
|  |  | name
| ) |  |

Used to load module from system (by import)

Parameters

  name | name of the module to import

Returns
  Returns result of import operation

Definition at line 84 of file host_test_registry.py.

## print_error()

def mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry.print_error | ( |  | self,
|  |  | text
| ) |  |

Prints error directly on console.

       @param text Error message text message

Definition at line 27 of file host_test_registry.py.

## register_plugin()

def mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry.register_plugin | ( |  | self,
|  |  | plugin
| ) |  |

Registers and stores plugin inside registry for further use.

       @param plugin Plugin name

       @return True if plugin setup was successful and plugin can be registered, else False

       @details Method also calls plugin's setup() function to configure plugin if needed.
                Note: Different groups of plugins may demand different extra parameter. Plugins
                should be at least for one type of plugin configured with the same parameters
                because we do not know which of them will actually use particular parameter.

Definition at line 34 of file host_test_registry.py.

## Member Data Documentation

## PLUGINS

dictionary mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry.PLUGINS = {}

static

Definition at line 25 of file host_test_registry.py.

The documentation for this class was generated from the following file:

- mbed_host_tests/host_tests_plugins/host_test_registry.py