MCPcopy Create free account
hub / github.com/github/copilot-sdk / _make_options

Function _make_options

python/e2e/test_client_options_e2e.py:32–64  ·  view source on GitHub ↗

Build CopilotClient kwargs pre-populated for the test harness.

(
    ctx: E2ETestContext,
    *,
    use_tcp: bool = False,
    port: int = 0,
    connection_token: str | None = None,
    cli_path: str | None = None,
    cli_args: list[str] | None = None,
    **overrides,
)

Source from the content-addressed store, hash-verified

30
31
32def _make_options(
33 ctx: E2ETestContext,
34 *,
35 use_tcp: bool = False,
36 port: int = 0,
37 connection_token: str | None = None,
38 cli_path: str | None = None,
39 cli_args: list[str] | None = None,
40 **overrides,
41) -> dict[str, object]:
42 """Build CopilotClient kwargs pre-populated for the test harness."""
43 if use_tcp:
44 connection: RuntimeConnection = RuntimeConnection.for_tcp(
45 port=port,
46 connection_token=connection_token,
47 path=cli_path if cli_path is not None else ctx.cli_path,
48 args=tuple(cli_args or []),
49 )
50 else:
51 connection = RuntimeConnection.for_stdio(
52 path=cli_path if cli_path is not None else ctx.cli_path,
53 args=tuple(cli_args or []),
54 )
55 base: dict[str, object] = {
56 "connection": connection,
57 "working_directory": ctx.work_dir,
58 "env": ctx.get_env(),
59 "github_token": (
60 "fake-token-for-e2e-tests" if os.environ.get("GITHUB_ACTIONS") == "true" else None
61 ),
62 }
63 base.update(overrides)
64 return base
65
66
67def _get_available_port() -> int:

Calls 5

for_tcpMethod · 0.80
for_stdioMethod · 0.80
get_envMethod · 0.45
getMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…