blob: 21dd37a031f3bb573eec7ab61191e1b1a96b2fc9 [file] [log] [blame]
jrperritt3d966162016-06-06 14:08:54 -05001package testing
2
3import (
4 "testing"
5
6 "github.com/gophercloud/gophercloud"
Krzysztof Szukiełojć24a29ce2017-05-07 14:24:02 +02007 th "gerrit.mcp.mirantis.net/debian/gophercloud.git/testhelper"
jrperritt3d966162016-06-06 14:08:54 -05008)
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}