fix tests

This commit is contained in:
Megan Marsh 2020-09-21 16:23:00 -07:00
parent ae8d359bf1
commit a805bc538e
3 changed files with 7 additions and 0 deletions

View File

@ -245,6 +245,7 @@ func TestStepDownload_download(t *testing.T) {
ui := &packer.BasicUi{
Reader: new(bytes.Buffer),
Writer: new(bytes.Buffer),
PB: &packer.NoopProgressTracker{},
}
dir := createTempDir(t)

View File

@ -16,6 +16,7 @@ func testState(t *testing.T) multistep.StateBag {
state.Put("ui", &packer.BasicUi{
Reader: new(bytes.Buffer),
Writer: new(bytes.Buffer),
PB: &packer.NoopProgressTracker{},
})
return state
}

View File

@ -126,6 +126,7 @@ func TestProvisionerProvision_SendsFile(t *testing.T) {
b := bytes.NewBuffer(nil)
ui := &packer.BasicUi{
Writer: b,
PB: &packer.NoopProgressTracker{},
}
comm := &packer.MockCommunicator{}
err = p.Provision(context.Background(), ui, comm, make(map[string]interface{}))
@ -184,6 +185,7 @@ func TestProvisionerProvision_SendsFileMultipleFiles(t *testing.T) {
b := bytes.NewBuffer(nil)
ui := &packer.BasicUi{
Writer: b,
PB: &packer.NoopProgressTracker{},
}
comm := &packer.MockCommunicator{}
err = p.Provision(context.Background(), ui, comm, make(map[string]interface{}))
@ -253,6 +255,7 @@ func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) {
b := bytes.NewBuffer(nil)
ui := &packer.BasicUi{
Writer: b,
PB: &packer.NoopProgressTracker{},
}
comm := &packer.MockCommunicator{}
err = p.Provision(context.Background(), ui, comm, make(map[string]interface{}))
@ -304,6 +307,7 @@ func TestProvisionerProvision_SendsFileMultipleFilesToFolder(t *testing.T) {
b := bytes.NewBuffer(nil)
ui := &packer.BasicUi{
Writer: b,
PB: &packer.NoopProgressTracker{},
}
comm := &packer.MockCommunicator{}
err = p.Provision(context.Background(), ui, comm, make(map[string]interface{}))
@ -361,6 +365,7 @@ func TestProvisionDownloadMkdirAll(t *testing.T) {
b := bytes.NewBuffer(nil)
ui := &packer.BasicUi{
Writer: b,
PB: &packer.NoopProgressTracker{},
}
comm := &packer.MockCommunicator{}
err = p.ProvisionDownload(ui, comm)