packer-cn/packer/post_processor_test.go

25 lines
515 B
Go
Raw Normal View History

package packer
2013-06-18 13:31:52 -04:00
type TestPostProcessor struct {
artifactId string
keep bool
2013-06-18 13:31:52 -04:00
configCalled bool
configVal []interface{}
2013-06-18 13:31:52 -04:00
ppCalled bool
ppArtifact Artifact
2013-06-19 00:54:33 -04:00
ppUi Ui
2013-06-18 13:31:52 -04:00
}
func (pp *TestPostProcessor) Configure(v ...interface{}) error {
2013-06-18 13:31:52 -04:00
pp.configCalled = true
pp.configVal = v
return nil
}
func (pp *TestPostProcessor) PostProcess(ui Ui, a Artifact) (Artifact, bool, error) {
2013-06-18 13:31:52 -04:00
pp.ppCalled = true
pp.ppArtifact = a
pp.ppUi = ui
return &TestArtifact{id: pp.artifactId}, pp.keep, nil
}