github.com/sneal/packer@v0.5.2/builder/openstack/artifact_test.go (about) 1 package openstack 2 3 import ( 4 "github.com/mitchellh/packer/packer" 5 "testing" 6 ) 7 8 func TestArtifact_Impl(t *testing.T) { 9 var _ packer.Artifact = new(Artifact) 10 } 11 12 func TestArtifactId(t *testing.T) { 13 expected := `b8cdf55b-c916-40bd-b190-389ec144c4ed` 14 15 a := &Artifact{ 16 ImageId: "b8cdf55b-c916-40bd-b190-389ec144c4ed", 17 } 18 19 result := a.Id() 20 if result != expected { 21 t.Fatalf("bad: %s", result) 22 } 23 } 24 25 func TestArtifactString(t *testing.T) { 26 expected := "An image was created: b8cdf55b-c916-40bd-b190-389ec144c4ed" 27 28 a := &Artifact{ 29 ImageId: "b8cdf55b-c916-40bd-b190-389ec144c4ed", 30 } 31 result := a.String() 32 if result != expected { 33 t.Fatalf("bad: %s", result) 34 } 35 }