2017-09-23 14:43:57 -04:00
|
|
|
package vsphere
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2018-04-18 17:53:59 -04:00
|
|
|
|
2020-12-17 16:29:25 -05:00
|
|
|
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
2017-09-23 14:43:57 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestArtifact_ImplementsArtifact(t *testing.T) {
|
|
|
|
var raw interface{}
|
|
|
|
raw = &Artifact{}
|
2020-11-19 15:17:11 -05:00
|
|
|
if _, ok := raw.(packersdk.Artifact); !ok {
|
2017-09-23 14:43:57 -04:00
|
|
|
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")
|
|
|
|
}
|
|
|
|
}
|