MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / TestCatchesNonExistentExternalDWOC

Function TestCatchesNonExistentExternalDWOC

pkg/config/sync_test.go:132–152  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

130}
131
132func TestCatchesNonExistentExternalDWOC(t *testing.T) {
133 setupForTest(t)
134
135 workspace := &dw.DevWorkspace{}
136 attributes := attributes.Attributes{}
137 namespacedName := types.NamespacedName{
138 Name: "external-config-name",
139 Namespace: "external-config-namespace",
140 }
141 attributes.Put(constants.ExternalDevWorkspaceConfiguration, namespacedName, nil)
142 workspace.Spec.Template.DevWorkspaceTemplateSpecContent = dw.DevWorkspaceTemplateSpecContent{
143 Attributes: attributes,
144 }
145 client := fake.NewClientBuilder().WithScheme(scheme).Build()
146
147 resolvedConfig, err := ResolveConfigForWorkspace(workspace, client)
148 if !assert.Error(t, err, "Error should be given if external DWOC specified in workspace spec does not exist") {
149 return
150 }
151 assert.Equal(t, resolvedConfig, internalConfig, "Internal/Global DWOC should be used as fallback if external DWOC could not be resolved")
152}
153
154func TestMergeExternalConfig(t *testing.T) {
155 setupForTest(t)

Callers

nothing calls this directly

Calls 4

PutMethod · 0.95
setupForTestFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected