Fix tests

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
This commit is contained in:
Dom Del Nano 2023-07-07 07:59:05 -07:00
parent 8ef30c26e4
commit dac47c649b
2 changed files with 12 additions and 15 deletions

View File

@ -4,11 +4,10 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/hashicorp/packer-plugin-sdk/packer"
"github.com/hashicorp/packer-plugin-sdk/common" "github.com/hashicorp/packer-plugin-sdk/common"
"github.com/hashicorp/packer-plugin-sdk/packer"
) )
func testConfig() map[string]interface{} { func testConfig() map[string]interface{} {
return map[string]interface{}{ return map[string]interface{}{
"remote_host": "localhost", "remote_host": "localhost",
@ -43,7 +42,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
t.Fatalf("should not have error: %s", err) t.Fatalf("should not have error: %s", err)
} }
if b.config.ToolsIsoName != "xs-tools.iso" { if b.config.ToolsIsoName != "" {
t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName) t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName)
} }
@ -201,10 +200,8 @@ func TestBuilderPrepare_ISOChecksum(t *testing.T) {
t.Fatal("should have error") t.Fatal("should have error")
} }
} }
func TestBuilderPrepare_ISOUrl(t *testing.T) { func TestBuilderPrepare_ISOUrl(t *testing.T) {
var b Builder var b Builder
config := testConfig() config := testConfig()

View File

@ -3,8 +3,8 @@ package xva
import ( import (
"testing" "testing"
"github.com/hashicorp/packer-plugin-sdk/packer"
"github.com/hashicorp/packer-plugin-sdk/common" "github.com/hashicorp/packer-plugin-sdk/common"
"github.com/hashicorp/packer-plugin-sdk/packer"
) )
func testConfig() map[string]interface{} { func testConfig() map[string]interface{} {
@ -40,7 +40,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
t.Fatalf("should not have error: %s", err) t.Fatalf("should not have error: %s", err)
} }
if b.config.ToolsIsoName != "xs-tools.iso" { if b.config.ToolsIsoName != "" {
t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName) t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName)
} }