betty.test_utils.plugin package - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.test_utils.plugin package

## Module contents

Test utilities for `betty.plugin`.

class betty.test_utils.plugin.DummyPlugin

  Bases: `Plugin`

  A dummy plugin implementation.

  classmethod plugin_id() → str

    Get the plugin ID.

    IDs are unique per plugin type:

    - A plugin repository MUST at most have a single plugin for any ID.

    - Different plugin repositories MAY each have a plugin with the same ID.

  classmethod plugin_label() → Localizable

    Get the human-readable short plugin label.

class betty.test_utils.plugin.PluginTestBase

  Bases: `Generic`[`_PluginT`]

  A base class for testing `betty.plugin.Plugin` implementations.

  get_sut_class() → type[_PluginT]

    Produce the class of the plugin under test.

  async test_plugin_description() → None

    Tests `betty.plugin.Plugin.plugin_description()` implementations.

  async test_plugin_id() → None

    Tests `betty.plugin.Plugin.plugin_id()` implementations.

  async test_plugin_label() → None

    Tests `betty.plugin.Plugin.plugin_label()` implementations.

betty.test_utils.plugin.assert_plugin_identifier(value: Any, plugin_type: type[_PluginT]) → None

  Assert that something is a plugin identifier.