MCPcopy Index your code
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / TestUserAgent

Function TestUserAgent

cmd/root_test.go:114–131  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestUserAgent(t *testing.T) {
115 cmd, err := invokeProxyCommand(
116 []string{
117 "--user-agent",
118 "cloud-sql-proxy-operator/0.0.1",
119 "proj:region:inst",
120 },
121 )
122 if err != nil {
123 t.Fatalf("want error = nil, got = %v", err)
124 }
125
126 want := "cloud-sql-proxy-operator/0.0.1"
127 got := cmd.conf.UserAgent
128 if !strings.Contains(got, want) {
129 t.Errorf("expected userAgent to contain: %v; got: %v", want, got)
130 }
131}
132
133func TestNewCommandArguments(t *testing.T) {
134 tcs := []struct {

Callers

nothing calls this directly

Calls 2

invokeProxyCommandFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected