From a98f2d21702edf89040db2d21eda8e69c376f7fc Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Fri, 20 Sep 2019 05:06:25 -0700 Subject: [PATCH] common: fix dropped errors and warnings in test --- common/iso_config_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/iso_config_test.go b/common/iso_config_test.go index b04e0933f..9ffe6fecf 100644 --- a/common/iso_config_test.go +++ b/common/iso_config_test.go @@ -164,7 +164,15 @@ func TestISOConfigPrepare_ISOUrl(t *testing.T) { i.RawSingleISOUrl = "" i.ISOChecksum = "" i.ISOChecksumURL = ts.URL + "/basic.txt" - warns, err = i.Prepare(nil) + // ISOConfig.Prepare() returns a slice of errors + var errs []error + warns, errs = i.Prepare(nil) + if len(warns) > 0 { + t.Fatalf("expected no warnings, got:%v", warns) + } + if len(errs) < 1 || err[0] == nil { + t.Fatalf("expected a populated error slice, got: %v", errs) + } // Test iso_url set i = testISOConfig()