github.com/emate/packer@v0.8.1-0.20150625195101-fe0fde195dc6/builder/digitalocean/artifact_test.go (about) 1 package digitalocean 2 3 import ( 4 "testing" 5 6 "github.com/mitchellh/packer/packer" 7 ) 8 9 func TestArtifact_Impl(t *testing.T) { 10 var raw interface{} 11 raw = &Artifact{} 12 if _, ok := raw.(packer.Artifact); !ok { 13 t.Fatalf("Artifact should be artifact") 14 } 15 } 16 17 func TestArtifactId(t *testing.T) { 18 a := &Artifact{"packer-foobar", 42, "San Francisco", nil} 19 expected := "42" 20 21 if a.Id() != expected { 22 t.Fatalf("artifact ID should match: %v", expected) 23 } 24 } 25 26 func TestArtifactString(t *testing.T) { 27 a := &Artifact{"packer-foobar", 42, "San Francisco", nil} 28 expected := "A snapshot was created: 'packer-foobar' in region 'San Francisco'" 29 30 if a.String() != expected { 31 t.Fatalf("artifact string should match: %v", expected) 32 } 33 }