mirror of
https://github.com/hashicorp/packer.git
synced 2026-02-24 02:10:31 -05:00
24 lines
383 B
Go
24 lines
383 B
Go
|
|
package openstack
|
||
|
|
|
||
|
|
import (
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
func testImageConfig() *ImageConfig {
|
||
|
|
return &ImageConfig{
|
||
|
|
ImageName: "foo",
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func TestImageConfigPrepare_Region(t *testing.T) {
|
||
|
|
c := testImageConfig()
|
||
|
|
if err := c.Prepare(nil); err != nil {
|
||
|
|
t.Fatalf("shouldn't have err: %s", err)
|
||
|
|
}
|
||
|
|
|
||
|
|
c.ImageName = ""
|
||
|
|
if err := c.Prepare(nil); err == nil {
|
||
|
|
t.Fatal("should have error")
|
||
|
|
}
|
||
|
|
}
|