From 0db9b7ad6793d440994c309ed2cc8a687ddc3e5a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 9 Dec 2013 14:46:33 -0800 Subject: [PATCH] packer/rpc: use packer.MockArtifact --- packer/rpc/artifact_test.go | 22 ---------------------- packer/rpc/build_test.go | 2 +- packer/rpc/builder_test.go | 2 +- packer/rpc/post_processor_test.go | 4 ++-- 4 files changed, 4 insertions(+), 26 deletions(-) diff --git a/packer/rpc/artifact_test.go b/packer/rpc/artifact_test.go index 4cc49df83..1cefe082f 100644 --- a/packer/rpc/artifact_test.go +++ b/packer/rpc/artifact_test.go @@ -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) diff --git a/packer/rpc/build_test.go b/packer/rpc/build_test.go index 3cb5e1fb2..60c2c0111 100644 --- a/packer/rpc/build_test.go +++ b/packer/rpc/build_test.go @@ -8,7 +8,7 @@ import ( "testing" ) -var testBuildArtifact = &testArtifact{} +var testBuildArtifact = &packer.MockArtifact{} type testBuild struct { nameCalled bool diff --git a/packer/rpc/builder_test.go b/packer/rpc/builder_test.go index fa20a4b85..81e65a0d1 100644 --- a/packer/rpc/builder_test.go +++ b/packer/rpc/builder_test.go @@ -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) diff --git a/packer/rpc/post_processor_test.go b/packer/rpc/post_processor_test.go index 75f3deca0..4f0ae871e 100644 --- a/packer/rpc/post_processor_test.go +++ b/packer/rpc/post_processor_test.go @@ -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 {