Commit e9f7a141 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer/rpc: use packer.MockArtifact

parent 105e5f6a
...@@ -6,28 +6,6 @@ import ( ...@@ -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 ( ...@@ -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 ( ...@@ -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 ( ...@@ -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) { ...@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment