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