Files
govoplan-poll/tests/test_manifest.py
T
zemion 7eb4b12fba
Module Package Release / publish-packages (push) Successful in 11s
docs: complete German structured documentation
2026-08-24 01:23:36 +02:00

41 lines
1.9 KiB
Python

from __future__ import annotations
import unittest
from govoplan_core.core.modules import ModuleManifest
from govoplan_poll.backend.manifest import get_manifest
from govoplan_poll.backend.participation import CAPABILITY_POLL_PARTICIPATION_GATEWAY
class PollManifestTests(unittest.TestCase):
def test_manifest_contract(self) -> None:
manifest = get_manifest()
self.assertIsInstance(manifest, ModuleManifest)
self.assertEqual(manifest.id, "poll")
self.assertNotIn("access", manifest.dependencies)
self.assertIn("access", manifest.optional_dependencies)
self.assertFalse(manifest.required_capabilities)
self.assertIn("auth.principalResolver", manifest.optional_capabilities)
self.assertIsNotNone(manifest.route_factory)
self.assertIsNotNone(manifest.public_tenant_resolver)
self.assertIsNotNone(manifest.migration_spec)
self.assertIn("poll.availability_matrix", {interface.name for interface in manifest.provides_interfaces})
self.assertIn("poll.workflow_context", {interface.name for interface in manifest.provides_interfaces})
self.assertIn("poll.signed_participation", {interface.name for interface in manifest.provides_interfaces})
self.assertIn("poll.governed_participation", {interface.name for interface in manifest.provides_interfaces})
self.assertIn(CAPABILITY_POLL_PARTICIPATION_GATEWAY, manifest.capability_factories)
self.assertEqual(manifest.version, "0.1.20")
self.assertIn("poll:response:write", {permission.scope for permission in manifest.permissions})
for topic in manifest.documentation:
german = topic.translations.get("de", {})
self.assertTrue(
all(german.get(field) for field in ("title", "summary", "body")),
topic.id,
)
if __name__ == "__main__":
unittest.main()