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