Merge pull request #8134 from alrs/fix-iso-test

common: fix dropped errors and warnings in test
This commit is contained in:
Adrien Delorme 2019-09-20 14:41:07 +02:00 committed by GitHub
commit 7066436ebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -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()