Jon Perritt | 8e08c06 | 2014-10-06 12:52:57 -0500 | [diff] [blame] | 1 | package gophercloud |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | th "github.com/rackspace/gophercloud/testhelper" |
| 7 | ) |
| 8 | |
| 9 | func 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 | } |