packer-cn/post-processor/vsphere/artifact_test.go

23 lines
502 B
Go
Raw Normal View History

package vsphere
import (
"testing"
2018-04-18 17:53:59 -04:00
"github.com/hashicorp/packer/packer"
)
func TestArtifact_ImplementsArtifact(t *testing.T) {
var raw interface{}
raw = &Artifact{}
if _, ok := raw.(packer.Artifact); !ok {
t.Fatalf("Artifact should be a Artifact")
}
}
func TestArtifact_Id(t *testing.T) {
artifact := NewArtifact("datastore", "vmfolder", "vmname", nil)
if artifact.Id() != "datastore::vmfolder::vmname" {
t.Fatalf("must return datastore, vmfolder and vmname splitted by :: as Id")
}
}