pulumi/cmd/config_test.go

21 lines
612 B
Go
Raw Normal View History

// Copyright 2016-2018, Pulumi Corporation. All rights reserved.
2017-10-18 19:10:04 +02:00
package cmd
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/pulumi/pulumi/pkg/resource/config"
"github.com/pulumi/pulumi/pkg/tokens"
"github.com/pulumi/pulumi/pkg/workspace"
)
2017-10-18 19:10:04 +02:00
func TestPrettyKeyForProject(t *testing.T) {
proj := &workspace.Project{Name: tokens.PackageName("test-package"), Runtime: "nodejs"}
assert.Equal(t, "foo", prettyKeyForProject(config.MustMakeKey("test-package", "foo"), proj))
assert.Equal(t, "other-package:bar", prettyKeyForProject(config.MustMakeKey("other-package", "bar"), proj))
2017-10-18 19:10:04 +02:00
}