Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (15 sloc) 531 Bytes
package gophercloud
import (
"testing"
th "github.com/rackspace/gophercloud/testhelper"
)
func TestApplyDefaultsToEndpointOpts(t *testing.T) {
eo := EndpointOpts{Availability: AvailabilityPublic}
eo.ApplyDefaults("compute")
expected := EndpointOpts{Availability: AvailabilityPublic, Type: "compute"}
th.CheckDeepEquals(t, expected, eo)
eo = EndpointOpts{Type: "compute"}
eo.ApplyDefaults("object-store")
expected = EndpointOpts{Availability: AvailabilityPublic, Type: "compute"}
th.CheckDeepEquals(t, expected, eo)
}