github.com/mitchellh/packer@v1.3.2/builder/vmware/iso/step_export_test.go (about)

     1  package iso
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  
     7  	"github.com/hashicorp/packer/helper/multistep"
     8  )
     9  
    10  func TestStepExport_impl(t *testing.T) {
    11  	var _ multistep.Step = new(StepExport)
    12  }
    13  
    14  func testStepExport_wrongtype_impl(t *testing.T, remoteType string) {
    15  	state := testState(t)
    16  	step := new(StepExport)
    17  
    18  	var config Config
    19  	config.RemoteType = "foo"
    20  	state.Put("config", &config)
    21  
    22  	if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
    23  		t.Fatalf("bad action: %#v", action)
    24  	}
    25  	if _, ok := state.GetOk("error"); ok {
    26  		t.Fatal("should NOT have error")
    27  	}
    28  
    29  	// Cleanup
    30  	step.Cleanup(state)
    31  }
    32  
    33  func TestStepExport_wrongtype_impl(t *testing.T) {
    34  	testStepExport_wrongtype_impl(t, "foo")
    35  	testStepExport_wrongtype_impl(t, "")
    36  }