MCPcopy Index your code
hub / github.com/devspace-sh/devspace / TestUserAgent

Function TestUserAgent

pkg/devspace/kubectl/client_test.go:117–139  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestUserAgent(t *testing.T) {
118 clusters := make(map[string]*api.Cluster)
119 clusters["fake-cluster"] = &api.Cluster{
120 Server: "fake-server",
121 }
122
123 contexts := make(map[string]*api.Context)
124 contexts["fake-context"] = &api.Context{
125 Cluster: "fake-cluster",
126 }
127
128 loader := &configTesting.Loader{
129 RawConfig: &api.Config{
130 Clusters: clusters,
131 Contexts: contexts,
132 },
133 }
134 client, err := NewClientFromContext("fake-context", "", false, loader)
135 if err != nil {
136 t.Fatal(err)
137 }
138 assert.Equal(t, client.RestConfig().UserAgent, "DevSpace Version "+upgrade.GetVersion())
139}
140
141type testCaseContext struct {
142 selectContext string

Callers

nothing calls this directly

Calls 5

GetVersionFunction · 0.92
NewClientFromContextFunction · 0.85
EqualMethod · 0.80
RestConfigMethod · 0.65
FatalMethod · 0.45

Tested by

no test coverage detected