Bound indexed retrieval operations
This commit is contained in:
parent
ad4f52b239
commit
c69cd16515
6 changed files with 208 additions and 46 deletions
|
|
@ -333,6 +333,9 @@ class DocForgeCoreTests(unittest.TestCase):
|
|||
self.assertEqual(
|
||||
["proof.validation"], [item["node_id"] for item in filtered["results"]]
|
||||
)
|
||||
limited_filter = index.filter_nodes(limit=1)
|
||||
self.assertEqual(1, limited_filter["count"])
|
||||
self.assertTrue(limited_filter["truncated"])
|
||||
dependencies = index.dependencies("guide.workflow", depth=2)
|
||||
self.assertEqual(
|
||||
["guide.foundation"], [item["node_id"] for item in dependencies["results"]]
|
||||
|
|
@ -346,6 +349,23 @@ class DocForgeCoreTests(unittest.TestCase):
|
|||
["guide.workflow", "proof.validation"],
|
||||
[item["node_id"] for item in impact["results"]],
|
||||
)
|
||||
limited = index.impact("guide.foundation", depth=2, limit=1)
|
||||
self.assertEqual(["guide.workflow"], [item["node_id"] for item in limited["results"]])
|
||||
self.assertEqual(1, limited["limit"])
|
||||
self.assertTrue(limited["truncated"])
|
||||
self.assertLessEqual(
|
||||
limited["examined_edges"],
|
||||
limited["examined_edges_limit"],
|
||||
)
|
||||
|
||||
complete_limit = index.dependencies("guide.workflow", depth=2, limit=1)
|
||||
self.assertEqual(1, complete_limit["count"])
|
||||
self.assertFalse(complete_limit["truncated"])
|
||||
|
||||
limited_backlinks = index.backlinks("guide.workflow", limit=1)
|
||||
self.assertEqual(1, limited_backlinks["count"])
|
||||
self.assertEqual(1, limited_backlinks["limit"])
|
||||
self.assertFalse(limited_backlinks["truncated"])
|
||||
|
||||
def test_query_rechecks_source_identity_before_returning(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue