blob: 34574534274c660d6c6222af351c88ba880bbe52 [file] [log] [blame]
Jon Perritt8e08c062014-10-06 12:52:57 -05001package gophercloud
2
3import (
4 "testing"
5
6 th "github.com/rackspace/gophercloud/testhelper"
7)
8
9func TestApplyDefaultsToEndpointOpts(t *testing.T) {
10 eo := EndpointOpts{Availability: AvailabilityPublic}
11 eo.ApplyDefaults("compute")
12 expected := EndpointOpts{Availability: AvailabilityPublic, Type: "compute"}
13 th.CheckDeepEquals(t, expected, eo)
14
15 eo = EndpointOpts{Type: "compute"}
16 eo.ApplyDefaults("object-store")
17 expected = EndpointOpts{Availability: AvailabilityPublic, Type: "compute"}
18 th.CheckDeepEquals(t, expected, eo)
19}