2023-04-19 23:13:33 +00:00
|
|
|
package config_tests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
2023-05-16 16:35:39 +00:00
|
|
|
"github.com/databricks/cli/bundle"
|
|
|
|
"github.com/databricks/cli/bundle/config/interpolation"
|
2023-04-19 23:13:33 +00:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestInterpolation(t *testing.T) {
|
|
|
|
b := load(t, "./interpolation")
|
2023-05-24 12:45:19 +00:00
|
|
|
err := bundle.Apply(context.Background(), b, interpolation.Interpolate(
|
|
|
|
interpolation.IncludeLookupsInPath("bundle"),
|
|
|
|
interpolation.IncludeLookupsInPath("workspace"),
|
|
|
|
))
|
2023-04-19 23:13:33 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
assert.Equal(t, "foo bar", b.Config.Bundle.Name)
|
|
|
|
assert.Equal(t, "foo bar | bar", b.Config.Resources.Jobs["my_job"].Name)
|
|
|
|
}
|