packer-cn/packer/artifact_test.go

39 lines
584 B
Go
Raw Normal View History

2013-06-18 13:54:22 -04:00
package packer
type TestArtifact struct {
id string
state map[string]interface{}
destroyCalled bool
}
2013-06-18 13:54:22 -04:00
func (*TestArtifact) BuilderId() string {
return "bid"
}
func (*TestArtifact) Files() []string {
return []string{"a", "b"}
}
func (a *TestArtifact) Id() string {
id := a.id
if id == "" {
id = "id"
}
return id
2013-06-18 13:54:22 -04:00
}
func (*TestArtifact) String() string {
return "string"
}
func (a *TestArtifact) State(name string) interface{} {
value := a.state[name]
return value
}
func (a *TestArtifact) Destroy() error {
a.destroyCalled = true
return nil
}