From 23762a181037c4e9871cb9280edddcf7493ef46f Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 6 Sep 2018 15:53:07 +0200 Subject: [PATCH] fix tests for common/download_test.go --- common/download_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/common/download_test.go b/common/download_test.go index ea6d7585e..dd41d6cc1 100644 --- a/common/download_test.go +++ b/common/download_test.go @@ -38,7 +38,7 @@ func TestDownloadClientVerifyChecksum(t *testing.T) { Checksum: checksum, } - d := NewDownloadClient(config, new(packer.NoopProgressBar)) + d := NewDownloadClient(config, new(packer.NoopUi)) result, err := d.VerifyChecksum(tf.Name()) if err != nil { t.Fatalf("Verify err: %s", err) @@ -61,7 +61,7 @@ func TestDownloadClient_basic(t *testing.T) { Url: ts.URL + "/basic.txt", TargetPath: tf.Name(), CopyFile: true, - }, new(packer.NoopProgressBar)) + }, new(packer.NoopUi)) path, err := client.Get() if err != nil { @@ -97,7 +97,7 @@ func TestDownloadClient_checksumBad(t *testing.T) { Hash: HashForType("md5"), Checksum: checksum, CopyFile: true, - }, new(packer.NoopProgressBar)) + }, new(packer.NoopUi)) if _, err := client.Get(); err == nil { t.Fatal("should error") @@ -123,7 +123,7 @@ func TestDownloadClient_checksumGood(t *testing.T) { Hash: HashForType("md5"), Checksum: checksum, CopyFile: true, - }, new(packer.NoopProgressBar)) + }, new(packer.NoopUi)) path, err := client.Get() if err != nil { @@ -155,7 +155,7 @@ func TestDownloadClient_checksumNoDownload(t *testing.T) { Hash: HashForType("md5"), Checksum: checksum, CopyFile: true, - }, new(packer.NoopProgressBar)) + }, new(packer.NoopUi)) path, err := client.Get() if err != nil { t.Fatalf("err: %s", err) @@ -185,7 +185,7 @@ func TestDownloadClient_notFound(t *testing.T) { client := NewDownloadClient(&DownloadConfig{ Url: ts.URL + "/not-found.txt", TargetPath: tf.Name(), - }, new(packer.NoopProgressBar)) + }, new(packer.NoopUi)) if _, err := client.Get(); err == nil { t.Fatal("should error") @@ -213,7 +213,7 @@ func TestDownloadClient_resume(t *testing.T) { Url: ts.URL, TargetPath: tf.Name(), CopyFile: true, - }, new(packer.NoopProgressBar)) + }, new(packer.NoopUi)) path, err := client.Get() if err != nil { @@ -275,7 +275,7 @@ func TestDownloadClient_usesDefaultUserAgent(t *testing.T) { CopyFile: true, } - client := NewDownloadClient(config, new(packer.NoopProgressBar)) + client := NewDownloadClient(config, new(packer.NoopUi)) _, err = client.Get() if err != nil { t.Fatal(err) @@ -308,7 +308,7 @@ func TestDownloadClient_setsUserAgent(t *testing.T) { CopyFile: true, } - client := NewDownloadClient(config, new(packer.NoopProgressBar)) + client := NewDownloadClient(config, new(packer.NoopUi)) _, err = client.Get() if err != nil { t.Fatal(err) @@ -407,7 +407,7 @@ func TestDownloadFileUrl(t *testing.T) { CopyFile: false, } - client := NewDownloadClient(config, new(packer.NoopProgressBar)) + client := NewDownloadClient(config, new(packer.NoopUi)) // Verify that we fail to match the checksum _, err = client.Get() @@ -438,7 +438,7 @@ func SimulateFileUriDownload(t *testing.T, uri string) (string, error) { } // go go go - client := NewDownloadClient(config, new(packer.NoopProgressBar)) + client := NewDownloadClient(config, new(packer.NoopUi)) path, err := client.Get() // ignore any non-important checksum errors if it's not a unc path