MCPcopy
hub / github.com/SciPhi-AI/R2R / test_communities

Function test_communities

py/tests/unit/database/test_graphs.py:135–156  ·  view source on GitHub ↗
(graphs_handler)

Source from the content-addressed store, hash-verified

133
134@pytest.mark.asyncio
135async def test_communities(graphs_handler):
136 # Insert a community for a collection_id (not strictly related to a graph_id)
137 coll_id = uuid.uuid4()
138 await graphs_handler.communities.create(
139 parent_id=coll_id,
140 store_type=StoreType.GRAPHS,
141 name="CommunityOne",
142 summary="Test community",
143 findings=["finding1", "finding2"],
144 rating=4.5,
145 rating_explanation="Excellent",
146 description_embedding=[0.1, 0.2, 0.3, 0.4],
147 )
148
149 comms, count = await graphs_handler.communities.get(
150 parent_id=coll_id,
151 store_type=StoreType.GRAPHS,
152 offset=0,
153 limit=10,
154 )
155 assert count == 1
156 assert comms[0].name == "CommunityOne"
157
158
159# TODO - Fix code such that these tests pass

Callers

nothing calls this directly

Calls 2

createMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected