MCPcopy Create free account
hub / github.com/cocoindex-io/cocoindex-code / test_index_streams_progress

Function test_index_streams_progress

tests/test_daemon.py:225–239  ·  view source on GitHub ↗

Indexing a new project should stream IndexProgressUpdate before IndexResponse.

(daemon_sock: str)

Source from the content-addressed store, hash-verified

223
224
225def test_index_streams_progress(daemon_sock: str) -> None:
226 """Indexing a new project should stream IndexProgressUpdate before IndexResponse."""
227 project = Path(tempfile.mkdtemp(prefix="ccc_strm_"))
228 save_project_settings(project, default_project_settings())
229 (project / "main.py").write_text(SAMPLE_MAIN_PY)
230
231 conn, _ = _connect_and_handshake(daemon_sock)
232 conn.send_bytes(encode_request(IndexRequest(project_root=str(project))))
233 updates, final = _recv_index_response(conn)
234 conn.close()
235
236 assert final.success is True
237 assert len(updates) > 0, "Expected at least one IndexProgressUpdate"
238 for u in updates:
239 assert u.progress.num_execution_starts >= 0
240
241
242def test_daemon_remove_project(daemon_sock: str, daemon_project: str) -> None:

Callers

nothing calls this directly

Calls 7

save_project_settingsFunction · 0.90
default_project_settingsFunction · 0.90
encode_requestFunction · 0.90
IndexRequestClass · 0.90
_recv_index_responseFunction · 0.85
closeMethod · 0.80
_connect_and_handshakeFunction · 0.70

Tested by

no test coverage detected