eegprep.ExtensionTestHarness#

class eegprep.ExtensionTestHarness(spec)#

Bases: object

Assertion helper for extension author test suites.

Parameters:

spec (ExtensionSpec)

__init__(spec)#
Parameters:

spec (ExtensionSpec)

Return type:

None

Methods

__init__(spec)

assert_action_callable(action_name)

Load and return one action target, asserting that it is callable.

assert_action_history_result(action_name, ...)

Call an action and assert it returns an EEGLAB-style (EEG, com) result.

assert_actions_load()

Assert that every declared action lazy target loads to a callable object.

assert_all_static_contracts()

Assert static spec, menu, help, action, and pop_* loading contracts.

assert_help_resources_exist()

Assert that every declared help resource is packaged and readable.

assert_menus_register()

Assert that every declared menu references a declared action or pop_* function.

assert_pop_function_callable(pop_function_name)

Load and return one pop_* target, asserting that it is callable.

assert_pop_function_history_result(...)

Call a pop_* function with return_com=True and assert (EEG, com) output.

assert_pop_functions_load()

Assert that every declared pop_* lazy target loads to a callable object.

assert_spec_valid(*[, current_version, ...])

Assert that the spec passes EEGPrep registry validation.

from_entry_point(entry_point_name, *[, ...])

Load an extension spec from the eegprep.extensions entry-point group.

classmethod from_entry_point(entry_point_name, *, entry_points_provider=<function entry_points>, current_version=None, version_provider=<function version>)#

Load an extension spec from the eegprep.extensions entry-point group.

Parameters:
  • entry_point_name (str)

  • entry_points_provider (Any)

  • current_version (str | None)

  • version_provider (Any)

Return type:

ExtensionTestHarness

assert_spec_valid(*, current_version=None, version_provider=<function version>, check_resources=True)#

Assert that the spec passes EEGPrep registry validation.

Parameters:
  • current_version (str | None)

  • version_provider (Any)

  • check_resources (bool)

Return type:

None

assert_menus_register()#

Assert that every declared menu references a declared action or pop_* function.

Return type:

None

assert_help_resources_exist()#

Assert that every declared help resource is packaged and readable.

Return type:

None

assert_actions_load()#

Assert that every declared action lazy target loads to a callable object.

Return type:

None

assert_pop_functions_load()#

Assert that every declared pop_* lazy target loads to a callable object.

Return type:

None

assert_action_callable(action_name)#

Load and return one action target, asserting that it is callable.

Parameters:

action_name (str)

Return type:

Any

assert_pop_function_callable(pop_function_name)#

Load and return one pop_* target, asserting that it is callable.

Parameters:

pop_function_name (str)

Return type:

Any

assert_action_history_result(action_name, *args, **kwargs)#

Call an action and assert it returns an EEGLAB-style (EEG, com) result.

Parameters:
Return type:

tuple[Any, str]

assert_pop_function_history_result(pop_function_name, *args, **kwargs)#

Call a pop_* function with return_com=True and assert (EEG, com) output.

Parameters:
  • pop_function_name (str)

  • args (Any)

  • kwargs (Any)

Return type:

tuple[Any, str]

assert_all_static_contracts()#

Assert static spec, menu, help, action, and pop_* loading contracts.

Return type:

None