47 lines
1.7 KiB
Python
47 lines
1.7 KiB
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from govoplan_core.core.modules import (
|
|
documentation_structured_translation_issues,
|
|
user_workflow_scope_condition_issues,
|
|
)
|
|
from govoplan_risk_compliance.backend.manifest import manifest
|
|
|
|
|
|
class RiskComplianceDocumentationTests(unittest.TestCase):
|
|
def test_public_topics_have_complete_german_reference_content(self) -> None:
|
|
topics = {topic.id: topic for topic in manifest.documentation}
|
|
self.assertEqual(
|
|
len(manifest.documentation), len(topics), "Documentation topic IDs must be unique"
|
|
)
|
|
self.assertLessEqual(
|
|
{
|
|
"risk_compliance.module-boundary",
|
|
"risk_compliance.data-subject-requests",
|
|
"risk_compliance.workspace-layout",
|
|
},
|
|
set(topics),
|
|
)
|
|
self.assertLessEqual(
|
|
{"user", "admin"},
|
|
set(topics["risk_compliance.workspace-layout"].documentation_types),
|
|
)
|
|
for topic in manifest.documentation:
|
|
translation = topic.translations.get("de", {})
|
|
self.assertTrue(
|
|
all(translation.get(key) for key in ("title", "summary", "body"))
|
|
)
|
|
self.assertEqual((), documentation_structured_translation_issues(topic))
|
|
|
|
def test_documentation_has_scope_conditioned_workflow_and_reference(self) -> None:
|
|
kinds = {topic.metadata.get("kind") for topic in manifest.documentation}
|
|
self.assertIn("workflow", kinds)
|
|
self.assertIn("reference", kinds)
|
|
for topic in manifest.documentation:
|
|
self.assertEqual((), user_workflow_scope_condition_issues(topic))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|