MCPcopy
hub / github.com/cortexlabs/cortex / TestSimple

Function TestSimple

pkg/lib/configreader/reader_test.go:33–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestSimple(t *testing.T) {
34 structValidation := &StructValidation{
35 StructFieldValidations: []*StructFieldValidation{
36 {
37 // Key: "key1",
38 StructField: "Key1",
39 BoolValidation: &BoolValidation{
40 Required: true,
41 },
42 },
43 {
44 // Key: "key2",
45 StructField: "Key2",
46 BoolValidation: &BoolValidation{
47 Default: true,
48 },
49 },
50 },
51 Required: true,
52 ShortCircuit: true,
53 }
54
55 configData := MustReadYAMLStr(
56 `
57 key1: true
58 `)
59
60 expected := &SimpleConfig{
61 Key1: true,
62 Key2: true,
63 }
64
65 testConfig(structValidation, configData, expected, t)
66}
67
68type NestedConfig struct {
69 Key0 float64 `json:"key0"`

Callers

nothing calls this directly

Calls 2

MustReadYAMLStrFunction · 0.85
testConfigFunction · 0.85

Tested by

no test coverage detected