Test utils

python-mcollective test utils.

pymco.test.ctxt

Context information for sourcing test templates.

pymco.test.ctxt.ROOT

Tests root directory.

pymco.test.ctxt.DEFAULT_CTXT

Default context used for sourcing MCollective configuration template.

pymco.test.ctxt.TEST_CFG

Tests configuration file name (full path).

pymco.test.ctxt.MSG

MCollective sample message dictionary.

pymco.test.utils

Utils for testing purposes.

pymco.test.utils.configfile(ctxt=None)[source]

Create a MCollective configuration file.

Parameters:ctxt (dict) – the ctxt to be used for rendering MCollective configuration template.
Returns:The path where the configuration file has been placed (pymco.test.ctxt.TEST_CFG).
pymco.test.utils.get_template(name, package='pymco.test')[source]

Load Jinja 2 template from given package.

Parameters:
  • name – template name.
  • package – package to be used for loading the template, default is current package.
Returns:

jinja2.environment.Template object.