blob: bd9c002b71b6bc47332214d15f6c801c284b0f4d [file] [log] [blame]
jrperritt3d966162016-06-06 14:08:54 -05001package testing
2
3import (
4 "testing"
5
Krzysztof Szukiełojć3f41d082017-05-07 14:43:06 +02006 "gerrit.mcp.mirantis.net/debian/gophercloud.git"
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}