blob: bd9c002b71b6bc47332214d15f6c801c284b0f4d [file] [log] [blame]
package testing
import (
"testing"
"gerrit.mcp.mirantis.net/debian/gophercloud.git"
th "gerrit.mcp.mirantis.net/debian/gophercloud.git/testhelper"
)
func TestApplyDefaultsToEndpointOpts(t *testing.T) {
eo := gophercloud.EndpointOpts{Availability: gophercloud.AvailabilityPublic}
eo.ApplyDefaults("compute")
expected := gophercloud.EndpointOpts{Availability: gophercloud.AvailabilityPublic, Type: "compute"}
th.CheckDeepEquals(t, expected, eo)
eo = gophercloud.EndpointOpts{Type: "compute"}
eo.ApplyDefaults("object-store")
expected = gophercloud.EndpointOpts{Availability: gophercloud.AvailabilityPublic, Type: "compute"}
th.CheckDeepEquals(t, expected, eo)
}