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

Function test_daemon_remove_project

tests/test_daemon.py:242–257  ·  view source on GitHub ↗

Removing a loaded project should make it disappear from the status list.

(daemon_sock: str, daemon_project: str)

Source from the content-addressed store, hash-verified

240
241
242def test_daemon_remove_project(daemon_sock: str, daemon_project: str) -> None:
243 """Removing a loaded project should make it disappear from the status list."""
244 conn, _ = _connect_and_handshake(daemon_sock)
245 conn.send_bytes(encode_request(RemoveProjectRequest(project_root=daemon_project)))
246 resp = decode_response(conn.recv_bytes())
247 assert hasattr(resp, "ok")
248 assert resp.ok is True
249 conn.close()
250
251 # Verify project is gone from daemon status (fresh connection)
252 conn2, _ = _connect_and_handshake(daemon_sock)
253 conn2.send_bytes(encode_request(DaemonStatusRequest()))
254 status = decode_response(conn2.recv_bytes())
255 project_roots = [p.project_root for p in status.projects]
256 assert daemon_project not in project_roots
257 conn2.close()
258
259
260def test_daemon_remove_project_not_loaded(daemon_sock: str) -> None:

Callers

nothing calls this directly

Calls 6

encode_requestFunction · 0.90
decode_responseFunction · 0.90
DaemonStatusRequestClass · 0.90
closeMethod · 0.80
_connect_and_handshakeFunction · 0.70

Tested by

no test coverage detected