2013-05-22 01:28:41 -04:00
|
|
|
package amazonebs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"cgl.tideland.biz/asserts"
|
|
|
|
"github.com/mitchellh/packer/packer"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestArtifact_Impl(t *testing.T) {
|
|
|
|
assert := asserts.NewTestingAsserts(t, true)
|
|
|
|
|
|
|
|
var actual packer.Artifact
|
|
|
|
assert.Implementor(&artifact{}, &actual, "should be an Artifact")
|
|
|
|
}
|
|
|
|
|
2013-06-26 20:40:21 -04:00
|
|
|
func TestArtifactId(t *testing.T) {
|
|
|
|
assert := asserts.NewTestingAsserts(t, true)
|
|
|
|
|
|
|
|
expected := `east:foo,west:bar`
|
|
|
|
|
|
|
|
amis := make(map[string]string)
|
|
|
|
amis["east"] = "foo"
|
|
|
|
amis["west"] = "bar"
|
|
|
|
|
|
|
|
a := &artifact{amis, nil}
|
|
|
|
result := a.Id()
|
|
|
|
assert.Equal(result, expected, "should match output")
|
|
|
|
}
|
|
|
|
|
2013-05-22 01:28:41 -04:00
|
|
|
func TestArtifactString(t *testing.T) {
|
|
|
|
assert := asserts.NewTestingAsserts(t, true)
|
|
|
|
|
|
|
|
expected := `AMIs were created:
|
|
|
|
|
|
|
|
east: foo
|
|
|
|
west: bar`
|
|
|
|
|
|
|
|
amis := make(map[string]string)
|
|
|
|
amis["east"] = "foo"
|
|
|
|
amis["west"] = "bar"
|
|
|
|
|
2013-06-18 19:24:35 -04:00
|
|
|
a := &artifact{amis, nil}
|
2013-05-22 01:28:41 -04:00
|
|
|
result := a.String()
|
|
|
|
assert.Equal(result, expected, "should match output")
|
|
|
|
}
|