MCPcopy Create free account
hub / github.com/google/go-cloud / FakeGCPCredentials

Function FakeGCPCredentials

internal/testing/setup/setup.go:47–49  ·  view source on GitHub ↗

FakeGCPCredentials gets fake GCP credentials.

(ctx context.Context)

Source from the content-addressed store, hash-verified

45
46// FakeGCPCredentials gets fake GCP credentials.
47func FakeGCPCredentials(ctx context.Context) (*google.Credentials, error) {
48 return google.CredentialsFromJSON(ctx, []byte(`{"type": "service_account", "project_id": "my-project-id"}`))
49}
50
51func awsV2Config(ctx context.Context, region string, client *http.Client) (awsv2.Config, error) {
52 // Provide fake creds if running in replay mode.

Callers 9

TestNewHTTPClientFunction · 0.92
TestDefaultProjectIDFunction · 0.92
TestOpenTopicFunction · 0.92
TestOpenSubscriptionFunction · 0.92
TestOpenTopicFunction · 0.92
TestOpenSubscriptionFunction · 0.92
TestNoConnectionErrorFunction · 0.92
TestNoConnectionErrorFunction · 0.92

Calls

no outgoing calls

Tested by 9

TestNewHTTPClientFunction · 0.74
TestDefaultProjectIDFunction · 0.74
TestOpenTopicFunction · 0.74
TestOpenSubscriptionFunction · 0.74
TestOpenTopicFunction · 0.74
TestOpenSubscriptionFunction · 0.74
TestNoConnectionErrorFunction · 0.74
TestNoConnectionErrorFunction · 0.74