betty.test_utils.plugin package

Submodules

Module contents

Test utilities for betty.plugin.

class betty.test_utils.plugin.DummyPlugin[source]

Bases: Plugin

A dummy plugin implementation.

classmethod plugin_id() str[source]

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[source]

Get the human-readable short plugin label.

class betty.test_utils.plugin.PluginInstanceTestBase[source]

Bases: Generic[_PluginT], PluginTestBase[_PluginT]

A base class for testing betty.plugin.Plugin implementation instances.

get_sut_instances() Sequence[_PluginT][source]

Produce instances of the plugin under test.

class betty.test_utils.plugin.PluginTestBase[source]

Bases: Generic[_PluginT]

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

get_sut_class() type[_PluginT][source]

Produce the class of the plugin under test.

async test_class_is_public() None[source]

Tests that the plugin class is public.

async test_plugin_description() None[source]

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

async test_plugin_id() None[source]

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

async test_plugin_label() None[source]

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

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

Assert that something is a plugin identifier.