|
|
|
|
@ -284,3 +284,35 @@ func TestISOConfigPrepare_ISOUrl(t *testing.T) {
|
|
|
|
|
t.Fatalf("bad: %#v", i.ISOUrls)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestISOConfigPrepare_TargetExtension(t *testing.T) {
|
|
|
|
|
i := testISOConfig()
|
|
|
|
|
|
|
|
|
|
// Test the default value
|
|
|
|
|
warns, err := i.Prepare(nil)
|
|
|
|
|
if len(warns) > 0 {
|
|
|
|
|
t.Fatalf("bad: %#v", warns)
|
|
|
|
|
}
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if i.TargetExtension != "iso" {
|
|
|
|
|
t.Fatalf("should've found \"iso\" got: %s", i.TargetExtension)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test the lowercased value
|
|
|
|
|
i = testISOConfig()
|
|
|
|
|
i.TargetExtension = "DMG"
|
|
|
|
|
warns, err = i.Prepare(nil)
|
|
|
|
|
if len(warns) > 0 {
|
|
|
|
|
t.Fatalf("bad: %#v", warns)
|
|
|
|
|
}
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if i.TargetExtension != "dmg" {
|
|
|
|
|
t.Fatalf("should've lowercased: %s", i.TargetExtension)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|