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