MCPcopy
hub / github.com/redspread/spread / TestInputPod

Function TestInputPod

pkg/input/dir/input_test.go:17–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestInputPod(t *testing.T) {
18 input := testTempFileInput(t)
19 defer os.RemoveAll(input.Path())
20
21 kubePod := testKubePod()
22
23 podFile := fmt.Sprintf("test.%s.%s", PodExtension, testRandomExtension())
24 podPath := path.Join(input.Path(), podFile)
25 testWriteYAMLToFile(t, podPath, kubePod)
26
27 testClearTypeInfo(kubePod)
28
29 objects := testWriteRandomObjects(t, input.Path(), 5)
30
31 expectedPod, err := entity.NewPod(kubePod, kube.ObjectMeta{}, podPath)
32 assert.NoError(t, err)
33 expected, err := entity.NewApp([]entity.Entity{expectedPod}, kube.ObjectMeta{}, input.Path(), objects...)
34 assert.NoError(t, err)
35
36 actual, err := input.Build()
37 assert.NoError(t, err, "should have built entity successfully")
38
39 testCompareEntity(t, expected, actual)
40}
41
42func TestInputRCAndPod(t *testing.T) {
43 input := testTempFileInput(t)

Callers

nothing calls this directly

Calls 9

testTempFileInputFunction · 0.85
testKubePodFunction · 0.85
testRandomExtensionFunction · 0.85
testWriteYAMLToFileFunction · 0.85
testClearTypeInfoFunction · 0.85
testWriteRandomObjectsFunction · 0.85
testCompareEntityFunction · 0.85
PathMethod · 0.80
BuildMethod · 0.65

Tested by

no test coverage detected