jrperritt | 3d96616 | 2016-06-06 14:08:54 -0500 | [diff] [blame] | 1 | package testing |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/gophercloud/gophercloud" |
Krzysztof Szukiełojć | 24a29ce | 2017-05-07 14:24:02 +0200 | [diff] [blame^] | 7 | th "gerrit.mcp.mirantis.net/debian/gophercloud.git/testhelper" |
jrperritt | 3d96616 | 2016-06-06 14:08:54 -0500 | [diff] [blame] | 8 | ) |
| 9 | |
| 10 | func 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 | } |