2023-10-20 12:56:59 +00:00
|
|
|
package yamlloader_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2023-12-22 13:20:45 +00:00
|
|
|
"github.com/databricks/cli/libs/dyn"
|
2023-10-20 12:56:59 +00:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestYAMLMix01(t *testing.T) {
|
|
|
|
file := "testdata/mix_01.yml"
|
|
|
|
self := loadYAML(t, file)
|
2023-12-22 13:20:45 +00:00
|
|
|
assert.NotEqual(t, dyn.NilValue, self)
|
2023-10-20 12:56:59 +00:00
|
|
|
|
|
|
|
assert.True(t, self.Get("base_address").IsAnchor())
|
|
|
|
assert.False(t, self.Get("office_address").IsAnchor())
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestYAMLMix02(t *testing.T) {
|
|
|
|
file := "testdata/mix_02.yml"
|
|
|
|
self := loadYAML(t, file)
|
2023-12-22 13:20:45 +00:00
|
|
|
assert.NotEqual(t, dyn.NilValue, self)
|
2023-10-20 12:56:59 +00:00
|
|
|
|
|
|
|
assert.True(t, self.Get("base_colors").IsAnchor())
|
|
|
|
assert.False(t, self.Get("theme").IsAnchor())
|
|
|
|
}
|