mbed_host_tests.host_tests_plugins.host_test_registry.HostTestRegistry Class Reference

## Public Member Functions

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

## Static Public Attributes

dict | 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__()

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

Definition at line 132 of file host_test_registry.py.

## call_plugin()

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()

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()

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()

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()

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()

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

Prints error directly on console.

Parameters

  text | Error message text message

Definition at line 27 of file host_test_registry.py.

## register_plugin()

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

Registers and stores plugin inside registry for further use.

Parameters

  plugin | Plugin name

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

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

dict 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