MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / machine_endpoints

Function machine_endpoints

lib/cli/tests/test_api_keys.py:138–148  ·  view source on GitHub ↗

The endpoint and proxy settings the machine's environment held as the CLI started, VALUES alone, and none since: a test's own machine has its own.

(monkeypatch: pytest.MonkeyPatch, **values: str)

Source from the content-addressed store, hash-verified

136
137
138def machine_endpoints(monkeypatch: pytest.MonkeyPatch, **values: str) -> None:
139 """The endpoint and proxy settings the machine's environment held as the CLI
140 started, VALUES alone, and none since: a test's own machine has its own."""
141 monkeypatch.setattr(api_keys, "_MACHINE_ENDPOINTS", api_keys._endpoint_settings(values))
142 for name in ("OPENAI_BASE_URL", *api_keys._endpoint_settings(os.environ), *values):
143 # Set first, so teardown restores what the machine had after a test
144 # loads a project's `.env` into the environment.
145 monkeypatch.setenv(name, "")
146 monkeypatch.delenv(name)
147 for name, value in values.items():
148 monkeypatch.setenv(name, value)
149
150
151# At a terminal

Calls

no outgoing calls

Tested by

no test coverage detected