blob: 462316cadc425f526326cc39912e3cda5d7b220e [file] [log] [blame]
Jon Perritt8e08c062014-10-06 12:52:57 -05001package gophercloud
2
3import (
4 "testing"
5
Jon Perritt27249f42016-02-18 10:35:59 -06006 th "github.com/gophercloud/gophercloud/testhelper"
Jon Perritt8e08c062014-10-06 12:52:57 -05007)
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}