feat: expose organization hierarchy catalog
This commit is contained in:
@@ -240,6 +240,29 @@ class OrganizationHierarchyDirectoryTests(unittest.TestCase):
|
||||
project.matches[0].path[0].relation_type.id,
|
||||
)
|
||||
|
||||
def test_hierarchy_catalog_is_tenant_scoped_and_preserves_structure_links(
|
||||
self,
|
||||
) -> None:
|
||||
catalog = self.directory.hierarchy_catalog("tenant-1")
|
||||
empty = self.directory.hierarchy_catalog("tenant-2")
|
||||
|
||||
self.assertEqual(
|
||||
{self.employer.id, self.project.id},
|
||||
{item.id for item in catalog.structures},
|
||||
)
|
||||
self.assertEqual(
|
||||
{
|
||||
(self.employer_parent.id, self.employer.id),
|
||||
(self.project_parent.id, self.project.id),
|
||||
},
|
||||
{
|
||||
(item.id, item.structure_id)
|
||||
for item in catalog.relation_types
|
||||
},
|
||||
)
|
||||
self.assertEqual((), empty.structures)
|
||||
self.assertEqual((), empty.relation_types)
|
||||
|
||||
def test_bounded_paths_report_depth_and_cycles(self) -> None:
|
||||
bounded = self.directory.resolve_hierarchy_relatives(
|
||||
"tenant-1",
|
||||
|
||||
Reference in New Issue
Block a user