Permalink
Browse files

apply defaults method unit test

  • Loading branch information...
1 parent 34b4796 commit 8e08c063de4b877e21da4df8f6eb467cd2e9119d @jrperritt jrperritt committed Oct 6, 2014
Showing with 19 additions and 0 deletions.
  1. +19 −0 endpoint_search_test.go
@@ -0,0 +1,19 @@
+package gophercloud
+
+import (
+ "testing"
+
+ th "github.com/rackspace/gophercloud/testhelper"
+)
+
+func TestApplyDefaultsToEndpointOpts(t *testing.T) {
+ eo := EndpointOpts{Availability: AvailabilityPublic}
+ eo.ApplyDefaults("compute")
+ expected := EndpointOpts{Availability: AvailabilityPublic, Type: "compute"}
+ th.CheckDeepEquals(t, expected, eo)
+
+ eo = EndpointOpts{Type: "compute"}
+ eo.ApplyDefaults("object-store")
+ expected = EndpointOpts{Availability: AvailabilityPublic, Type: "compute"}
+ th.CheckDeepEquals(t, expected, eo)
+}

0 comments on commit 8e08c06

Please sign in to comment.