chore: fix test
This commit is contained in:
parent
09f57537bf
commit
2578bbbb50
|
@ -12,19 +12,25 @@ func TestAccessConfigPrepare_Region(t *testing.T) {
|
|||
c := testAccessConfig()
|
||||
|
||||
c.RawRegion = "us-east-12"
|
||||
err := c.ValidateRegion(c.RawRegion)
|
||||
err := c.ValidateOSCRegion(c.RawRegion)
|
||||
if err == nil {
|
||||
t.Fatalf("should have region validation err: %s", c.RawRegion)
|
||||
}
|
||||
|
||||
c.RawRegion = "us-east-1"
|
||||
err = c.ValidateRegion(c.RawRegion)
|
||||
err := c.ValidateOSCRegion(c.RawRegion)
|
||||
if err == nil {
|
||||
t.Fatalf("should have region validation err: %s", c.RawRegion)
|
||||
}
|
||||
|
||||
c.RawRegion = "us-west-1"
|
||||
err = c.ValidateOSCRegion(c.RawRegion)
|
||||
if err != nil {
|
||||
t.Fatalf("shouldn't have region validation err: %s", c.RawRegion)
|
||||
}
|
||||
|
||||
c.RawRegion = "custom"
|
||||
err = c.ValidateRegion(c.RawRegion)
|
||||
err = c.ValidateOSCRegion(c.RawRegion)
|
||||
if err == nil {
|
||||
t.Fatalf("should have region validation err: %s", c.RawRegion)
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ func listOSCRegions(oscconn *osc.RegionApiService) ([]string, error) {
|
|||
|
||||
// ValidateRegion returns true if the supplied region is a valid Outscale
|
||||
// region and false if it's not.
|
||||
func (c *AccessConfig) ValidateRegion(regions ...string) error {
|
||||
func (c *AccessConfig) ValidateOSCRegion(regions ...string) error {
|
||||
oscconn := c.NewOSCClient()
|
||||
|
||||
validRegions, err := listOSCRegions(oscconn.RegionApi)
|
||||
|
|
Loading…
Reference in New Issue