github.com/askholme/packer@v0.7.2-0.20140924152349-70d9566a6852/packer/post_processor_test.go (about)

     1  package packer
     2  
     3  type TestPostProcessor struct {
     4  	artifactId   string
     5  	keep         bool
     6  	configCalled bool
     7  	configVal    []interface{}
     8  	ppCalled     bool
     9  	ppArtifact   Artifact
    10  	ppUi         Ui
    11  }
    12  
    13  func (pp *TestPostProcessor) Configure(v ...interface{}) error {
    14  	pp.configCalled = true
    15  	pp.configVal = v
    16  	return nil
    17  }
    18  
    19  func (pp *TestPostProcessor) PostProcess(ui Ui, a Artifact) (Artifact, bool, error) {
    20  	pp.ppCalled = true
    21  	pp.ppArtifact = a
    22  	pp.ppUi = ui
    23  	return &TestArtifact{id: pp.artifactId}, pp.keep, nil
    24  }