45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from govoplan_forms_runtime.backend.manifest import (
|
|
ADMIN_SCOPE,
|
|
PARTICIPATE_SCOPE,
|
|
READ_SCOPE,
|
|
WRITE_SCOPE,
|
|
get_manifest,
|
|
)
|
|
|
|
|
|
class ManifestTests(unittest.TestCase):
|
|
def test_manifest_registers_definition_aware_runtime(self) -> None:
|
|
manifest = get_manifest()
|
|
|
|
self.assertEqual(manifest.id, "forms_runtime")
|
|
self.assertEqual(manifest.dependencies, ("access", "forms"))
|
|
self.assertEqual(
|
|
{permission.scope for permission in manifest.permissions},
|
|
{PARTICIPATE_SCOPE, READ_SCOPE, WRITE_SCOPE, ADMIN_SCOPE},
|
|
)
|
|
participant = next(
|
|
item
|
|
for item in manifest.role_templates
|
|
if item.slug == "forms_runtime_participant"
|
|
)
|
|
self.assertTrue(participant.default_authenticated)
|
|
self.assertIsNotNone(manifest.route_factory)
|
|
self.assertIsNotNone(manifest.migration_spec)
|
|
self.assertIsNotNone(manifest.frontend)
|
|
self.assertIn(
|
|
"forms_runtime.service_launcher",
|
|
manifest.capability_factories,
|
|
)
|
|
self.assertEqual(
|
|
"@govoplan/forms-runtime-webui",
|
|
manifest.frontend.package_name if manifest.frontend else None,
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|