Create and index a project once for the session. Returns project_root str.
(daemon_sock: str)
| 119 | |
| 120 | @pytest.fixture(scope="session") |
| 121 | def daemon_project(daemon_sock: str) -> str: |
| 122 | """Create and index a project once for the session. Returns project_root str.""" |
| 123 | project = Path(tempfile.mkdtemp(prefix="ccc_proj_")) |
| 124 | save_project_settings(project, default_project_settings()) |
| 125 | (project / "main.py").write_text(SAMPLE_MAIN_PY) |
| 126 | |
| 127 | conn = Client(daemon_sock, family=connection_family()) |
| 128 | conn.send_bytes(encode_request(HandshakeRequest(version=__version__))) |
| 129 | decode_response(conn.recv_bytes()) |
| 130 | conn.send_bytes(encode_request(IndexRequest(project_root=str(project)))) |
| 131 | _updates, final = _recv_index_response(conn) |
| 132 | assert final.success is True |
| 133 | conn.close() |
| 134 | |
| 135 | return str(project) |
| 136 | |
| 137 | |
| 138 | def _connect_and_handshake(sock_path: str) -> tuple[Connection, Response]: |
nothing calls this directly
no test coverage detected