github.com/raghuse92/packer@v1.3.2/builder/openstack/artifact_test.go (about)

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