MCPcopy
hub / github.com/kubernetes-sigs/kwok / TestConfig

Function TestConfig

pkg/config/config_test.go:32–63  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30)
31
32func TestConfig(t *testing.T) {
33 ctx := context.Background()
34 config := filepath.Join(t.TempDir(), "config.yaml")
35 data := []InternalObject{
36 &internalversion.KwokConfiguration{},
37 &internalversion.KwokctlConfiguration{},
38 &internalversion.Stage{},
39 }
40 err := Save(ctx, config, data)
41 if err != nil {
42 t.Fatal(err)
43 }
44
45 want, err := Load(ctx, config)
46 if err != nil {
47 t.Fatal(err)
48 }
49
50 err = Save(ctx, config, want)
51 if err != nil {
52 t.Fatal(err)
53 }
54
55 got, err := Load(ctx, config)
56 if err != nil {
57 t.Fatal(err)
58 }
59
60 if diff := cmp.Diff(want, got); diff != "" {
61 t.Error(diff)
62 }
63}
64
65func Test_loadRaw(t *testing.T) {
66 tests := []struct {

Callers

nothing calls this directly

Calls 3

SaveFunction · 0.85
LoadFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected