Release govoplan-views v0.1.22: unify interface contracts and documentation
This commit is contained in:
@@ -26,6 +26,7 @@ from govoplan_views.backend.db.models import (
|
||||
from govoplan_views.backend.dsar_provider import (
|
||||
VIEWS_DSAR_CAPABILITY,
|
||||
ViewsDsarProvider,
|
||||
_presentation_projection,
|
||||
)
|
||||
from govoplan_views.backend.manifest import manifest
|
||||
|
||||
@@ -118,6 +119,12 @@ class ViewsDsarProviderTests(unittest.TestCase):
|
||||
surface_contract_version="1.0.0",
|
||||
visible_surface_ids=["files.route.files"],
|
||||
presentation={
|
||||
"navigation": {
|
||||
"order": ["separator:work", "files.nav.files"],
|
||||
"hidden": ["mail.nav.mail"],
|
||||
"separators": [{"id": "separator:work", "label": "Personal layout", "private": "separator-private-do-not-export"}],
|
||||
"private": "navigation-private-do-not-export",
|
||||
},
|
||||
"navigation_mode": "flat",
|
||||
"quick_access_focused_tool_ids": ["files.recent"],
|
||||
"private_payload_do_not_export": f"private-{definition_id}",
|
||||
@@ -240,12 +247,28 @@ class ViewsDsarProviderTests(unittest.TestCase):
|
||||
exported = json.dumps([record.to_dict() for record in records])
|
||||
self.assertIn("My personal work", exported)
|
||||
self.assertIn("files.recent", exported)
|
||||
self.assertIn("Personal layout", exported)
|
||||
self.assertIn("files.nav.files", exported)
|
||||
self.assertNotIn("navigation-private-do-not-export", exported)
|
||||
self.assertNotIn("separator-private-do-not-export", exported)
|
||||
self.assertNotIn("personal-metadata-do-not-export", exported)
|
||||
self.assertNotIn("tenant-metadata-do-not-export", exported)
|
||||
self.assertNotIn("private-tenant-definition-do-not-export", exported)
|
||||
self.assertNotIn("definition-other-account", exported)
|
||||
self.assertNotIn("definition-other-tenant", exported)
|
||||
|
||||
def test_navigation_projection_is_bounded_and_preserves_inheritance(self) -> None:
|
||||
self.assertEqual({"navigation": None}, _presentation_projection({"navigation": None}))
|
||||
self.assertNotIn("separators", _presentation_projection({"navigation": {"order": []}})["navigation"])
|
||||
self.assertEqual([], _presentation_projection({"navigation": {"separators": []}})["navigation"]["separators"])
|
||||
for navigation in (
|
||||
{"order": ["files.nav.files"] * 257},
|
||||
{"separators": [{"id": "separator:work"}] * 257},
|
||||
{"separators": ["invalid"]},
|
||||
):
|
||||
with self.subTest(navigation=navigation), self.assertRaises(ValueError):
|
||||
_presentation_projection({"navigation": navigation})
|
||||
|
||||
def test_resource_references_narrow_and_conflicts_fail_closed(self) -> None:
|
||||
definition = self.provider.search_subject(
|
||||
self.session,
|
||||
|
||||
Reference in New Issue
Block a user