44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from govoplan_core.core.postbox import (
|
|
CAPABILITY_POSTBOX_ACCESS,
|
|
CAPABILITY_POSTBOX_DELIVERY,
|
|
CAPABILITY_POSTBOX_DIRECTORY,
|
|
CAPABILITY_POSTBOX_EVIDENCE,
|
|
CAPABILITY_POSTBOX_MESSAGES,
|
|
)
|
|
from govoplan_postbox.backend.manifest import get_manifest
|
|
|
|
|
|
class PostboxManifestTests(unittest.TestCase):
|
|
def test_manifest_announces_owned_contracts_and_dependencies(self) -> None:
|
|
manifest = get_manifest()
|
|
|
|
self.assertEqual(manifest.id, "postbox")
|
|
self.assertEqual(
|
|
{"identity", "organizations", "idm"},
|
|
set(manifest.dependencies),
|
|
)
|
|
self.assertEqual(
|
|
{
|
|
CAPABILITY_POSTBOX_DIRECTORY,
|
|
CAPABILITY_POSTBOX_ACCESS,
|
|
CAPABILITY_POSTBOX_MESSAGES,
|
|
CAPABILITY_POSTBOX_DELIVERY,
|
|
CAPABILITY_POSTBOX_EVIDENCE,
|
|
},
|
|
set(manifest.capability_factories),
|
|
)
|
|
self.assertEqual("@govoplan/postbox-webui", manifest.frontend.package_name)
|
|
self.assertEqual(["/postbox"], [route.path for route in manifest.frontend.routes])
|
|
self.assertIn(
|
|
"idm.function_assignments",
|
|
manifest.required_capabilities,
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|