fix failing tests

This commit is contained in:
Mitchell Hashimoto 2015-05-27 14:30:59 -07:00
parent cbe6e83b60
commit 4bb16ac223
5 changed files with 13 additions and 34 deletions

View File

@ -1,15 +1,11 @@
package common
import (
"github.com/mitchellh/packer/packer"
"testing"
"github.com/mitchellh/packer/template/interpolate"
)
func testConfigTemplate(t *testing.T) *packer.ConfigTemplate {
result, err := packer.NewConfigTemplate()
if err != nil {
t.Fatalf("err: %s", err)
}
return result
func testConfigTemplate(t *testing.T) *interpolate.Context {
return &interpolate.Context{}
}

View File

@ -9,7 +9,6 @@ import (
func TestStepTypeBootCommand(t *testing.T) {
state := testState(t)
tpl, _ := packer.NewConfigTemplate()
var bootcommand = []string{
"1234567890-=<enter><wait>",
@ -27,7 +26,7 @@ func TestStepTypeBootCommand(t *testing.T) {
BootCommand: bootcommand,
HostInterfaces: []string{},
VMName: "myVM",
Tpl: tpl,
Ctx: *testConfigTemplate(t),
}
comm := new(packer.MockCommunicator)

View File

@ -70,14 +70,6 @@ func TestToolsConfigPrepare_ParallelsToolsGuestPath(t *testing.T) {
t.Fatal("should not be empty")
}
// Test with a bad value
c = testToolsConfig()
c.ParallelsToolsGuestPath = "{{{nope}"
errs = c.Prepare(testConfigTemplate(t))
if len(errs) == 0 {
t.Fatal("should have error")
}
// Test with a good one
c = testToolsConfig()
c.ParallelsToolsGuestPath = "foo"

View File

@ -1,15 +1,11 @@
package common
import (
"github.com/mitchellh/packer/packer"
"testing"
"github.com/mitchellh/packer/template/interpolate"
)
func testConfigTemplate(t *testing.T) *packer.ConfigTemplate {
result, err := packer.NewConfigTemplate()
if err != nil {
t.Fatalf("err: %s", err)
}
return result
func testConfigTemplate(t *testing.T) *interpolate.Context {
return &interpolate.Context{}
}

View File

@ -1,15 +1,11 @@
package common
import (
"github.com/mitchellh/packer/packer"
"testing"
"github.com/mitchellh/packer/template/interpolate"
)
func testConfigTemplate(t *testing.T) *packer.ConfigTemplate {
result, err := packer.NewConfigTemplate()
if err != nil {
t.Fatalf("err: %s", err)
}
return result
func testConfigTemplate(t *testing.T) *interpolate.Context {
return &interpolate.Context{}
}