When `deferred`, the project comes from ADC on the first request instead of from the arguments.
(values: dict[str, str], *, deferred: bool, monkeypatch: pytest.MonkeyPatch)
| 87 | |
| 88 | |
| 89 | def _client_kwargs(values: dict[str, str], *, deferred: bool, monkeypatch: pytest.MonkeyPatch) -> dict[str, Any]: |
| 90 | """When `deferred`, the project comes from ADC on the first request instead of from the arguments.""" |
| 91 | if not deferred: |
| 92 | return {**values, "token_provider": lambda: "tok"} |
| 93 | |
| 94 | project = values["project"] |
| 95 | monkeypatch.setattr( |
| 96 | "anthropic.lib.google_cloud._client._load_adc_credentials", |
| 97 | lambda: (_FakeCredentials(token="adc-token"), project), |
| 98 | ) |
| 99 | return {name: value for name, value in values.items() if name != "project"} |
| 100 | |
| 101 | |
| 102 | def _expected_urls(segments: tuple[str, str, str]) -> list[str]: |
no test coverage detected