You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/packer/artifact_mock.go

34 lines
531 B

package packer
// MockArtifact is an implementation of Artifact that can be used for tests.
type MockArtifact struct {
IdValue string
DestroyCalled bool
}
func (*MockArtifact) BuilderId() string {
return "bid"
}
func (*MockArtifact) Files() []string {
return []string{"a", "b"}
}
func (a *MockArtifact) Id() string {
id := a.IdValue
if id == "" {
id = "id"
}
return id
}
func (*MockArtifact) String() string {
return "string"
}
func (a *MockArtifact) Destroy() error {
a.DestroyCalled = true
return nil
}