packer/rpc: use packer.MockArtifact
This commit is contained in:
parent
105e5f6a6d
commit
e9f7a1418c
|
@ -6,28 +6,6 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
type testArtifact struct{}
|
||||
|
||||
func (testArtifact) BuilderId() string {
|
||||
return "bid"
|
||||
}
|
||||
|
||||
func (testArtifact) Files() []string {
|
||||
return []string{"a", "b"}
|
||||
}
|
||||
|
||||
func (testArtifact) Id() string {
|
||||
return "id"
|
||||
}
|
||||
|
||||
func (testArtifact) String() string {
|
||||
return "string"
|
||||
}
|
||||
|
||||
func (testArtifact) Destroy() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func TestArtifactRPC(t *testing.T) {
|
||||
// Create the interface to test
|
||||
a := new(packer.MockArtifact)
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
var testBuildArtifact = &testArtifact{}
|
||||
var testBuildArtifact = &packer.MockArtifact{}
|
||||
|
||||
type testBuild struct {
|
||||
nameCalled bool
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
var testBuilderArtifact = &testArtifact{}
|
||||
var testBuilderArtifact = &packer.MockArtifact{}
|
||||
|
||||
func builderRPCClient(t *testing.T) (*packer.MockBuilder, packer.Builder) {
|
||||
b := new(packer.MockBuilder)
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
var testPostProcessorArtifact = new(testArtifact)
|
||||
var testPostProcessorArtifact = new(packer.MockArtifact)
|
||||
|
||||
type TestPostProcessor struct {
|
||||
configCalled bool
|
||||
|
@ -62,7 +62,7 @@ func TestPostProcessorRPC(t *testing.T) {
|
|||
}
|
||||
|
||||
// Test PostProcess
|
||||
a := new(testArtifact)
|
||||
a := new(packer.MockArtifact)
|
||||
ui := new(testUi)
|
||||
artifact, _, err := pClient.PostProcess(ui, a)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue