github.com/jerryclinesmith/packer@v0.3.7/builder/openstack/artifact_test.go (about)

     1  package openstack
     2  
     3  import (
     4  	"cgl.tideland.biz/asserts"
     5  	"github.com/mitchellh/packer/packer"
     6  	"testing"
     7  )
     8  
     9  func TestArtifact_Impl(t *testing.T) {
    10  	assert := asserts.NewTestingAsserts(t, true)
    11  
    12  	var actual packer.Artifact
    13  	assert.Implementor(&Artifact{}, &actual, "should be an Artifact")
    14  }
    15  
    16  func TestArtifactId(t *testing.T) {
    17  	assert := asserts.NewTestingAsserts(t, true)
    18  
    19  	expected := `b8cdf55b-c916-40bd-b190-389ec144c4ed`
    20  
    21  	a := &Artifact{
    22  		ImageId: "b8cdf55b-c916-40bd-b190-389ec144c4ed",
    23  	}
    24  
    25  	result := a.Id()
    26  	assert.Equal(result, expected, "should match output")
    27  }
    28  
    29  func TestArtifactString(t *testing.T) {
    30  	assert := asserts.NewTestingAsserts(t, true)
    31  
    32  	expected := "An image was created: b8cdf55b-c916-40bd-b190-389ec144c4ed"
    33  
    34  	a := &Artifact{
    35  		ImageId: "b8cdf55b-c916-40bd-b190-389ec144c4ed",
    36  	}
    37  	result := a.String()
    38  	assert.Equal(result, expected, "should match output")
    39  }