Skip to content

Commit

Permalink
Add test coverage for the betty.ancestry.event_type module (#1928)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartfeenstra authored Sep 1, 2024
1 parent 76d20f6 commit 2dbf41f
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions betty/test_utils/ancestry/event_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,37 @@
from __future__ import annotations

from betty.ancestry.event_type import EventType
from betty.test_utils.plugin import DummyPlugin, PluginTestBase
from betty.test_utils.plugin import (
DummyPlugin,
PluginTestBase,
assert_plugin_identifier,
)


class EventTypeTestBase(PluginTestBase[EventType]):
"""
A base class for testing :py:class:`betty.ancestry.event_type.EventType` implementations.
"""

pass
async def test_comes_after(self) -> None:
"""
Tests :py:meth:`betty.ancestry.event_type.EventType.comes_after` implementations.
"""
for event_type_id in self.get_sut_class().comes_after():
assert_plugin_identifier(
event_type_id,
EventType, # type: ignore[type-abstract]
)

async def test_comes_before(self) -> None:
"""
Tests :py:meth:`betty.ancestry.event_type.EventType.comes_before` implementations.
"""
for event_type_id in self.get_sut_class().comes_before():
assert_plugin_identifier(
event_type_id,
EventType, # type: ignore[type-abstract]
)


class DummyEventType(DummyPlugin, EventType):
Expand Down

0 comments on commit 2dbf41f

Please sign in to comment.